[analysis_server] Fix missing dartdoc references in Library comments
Fixes https://github.com/dart-lang/sdk/issues/59946 Change-Id: I3b8558f72b6cc932f2c87ee4f2e993c5584907a7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405361 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Samuel Rawlins <srawlins@google.com> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
committed by
Commit Queue
parent
0037a5c554
commit
154b473cdb
@@ -211,6 +211,40 @@ final foo = {"key": ?Foo()};
|
||||
expect(target.length, 3);
|
||||
}
|
||||
|
||||
Future<void> test_documentation() async {
|
||||
addTestFile('''
|
||||
/// [math]
|
||||
import 'dart:math' as math;
|
||||
''');
|
||||
await waitForTasksFinished();
|
||||
await _getNavigation(search: 'math]');
|
||||
expect(regions, hasLength(1));
|
||||
assertHasRegionString('math');
|
||||
expect(testTargets, hasLength(1));
|
||||
var target = targets[regions.first.targets.first];
|
||||
expect(target.kind, ElementKind.PREFIX);
|
||||
expect(target.offset, findOffset('math;'));
|
||||
expect(target.length, 4);
|
||||
}
|
||||
|
||||
Future<void> test_documentation_library() async {
|
||||
addTestFile('''
|
||||
/// [math]
|
||||
library;
|
||||
|
||||
import 'dart:math' as math;
|
||||
''');
|
||||
await waitForTasksFinished();
|
||||
await _getNavigation(search: 'math]');
|
||||
expect(regions, hasLength(1));
|
||||
assertHasRegionString('math');
|
||||
expect(testTargets, hasLength(1));
|
||||
var target = targets[regions.first.targets.first];
|
||||
expect(target.kind, ElementKind.PREFIX);
|
||||
expect(target.offset, findOffset('math;'));
|
||||
expect(target.length, 4);
|
||||
}
|
||||
|
||||
Future<void> test_field_underscore() async {
|
||||
addTestFile('''
|
||||
class C {
|
||||
|
||||
@@ -438,6 +438,7 @@ class _DartNavigationComputerVisitor extends RecursiveAstVisitor<void> {
|
||||
@override
|
||||
void visitLibraryDirective(LibraryDirective node) {
|
||||
computer._addRegionForElement(node.name2, node.element2);
|
||||
super.visitLibraryDirective(node);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user