Skip to content

Commit

Permalink
Version 3.8.0-15.0.dev
Browse files Browse the repository at this point in the history
Merge 667730a into dev
  • Loading branch information
Dart CI committed Jan 20, 2025
2 parents bf1e8ae + 667730a commit 481a7fd
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ class _DartUnitOccurrencesComputerVisitor extends RecursiveAstVisitor<void> {
super.visitGenericTypeAlias(node);
}

@override
void visitImportPrefixReference(ImportPrefixReference node) {
_addOccurrence(node.element2!, node.offset);

super.visitImportPrefixReference(node);
}

@override
void visitMethodDeclaration(MethodDeclaration node) {
_addOccurrence(node.declaredFragment!.element, node.name.offset);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,23 @@ String f(int char) {
''');
}

Future<void> test_prefix() async {
await assertOccurrences(kind: ElementKind.PREFIX, '''
import '' as /*[0*/p/*0]*/;
class A {
void m() {
/*[1*/p/*1]*/.foo();
print(/*[2*/p/*2]*/.a);
}
}
void foo() {}
/*[3*/p/*3]*/.A? a;
''');
}

Future<void> test_prefix_wildcard() async {
// Ensure no crash.
await assertOccurrences(kind: ElementKind.PREFIX, '''
Expand Down
15 changes: 15 additions & 0 deletions pkg/analysis_server/test/lsp/document_highlights_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,21 @@ void f() {
/*[2*/key/*2]*/;
}
}
''');

Future<void> test_prefix() => _testMarkedContent('''
import '' as /*[0*/p/*0]*/;
class A {
void m() {
/*[1*/p/*1]*/.foo();
print(/*[2*/p/*2]*/.a);
}
}
void foo() {}
/*[3*/p^/*3]*/.A? a;
''');

Future<void> test_prefixed() => _testMarkedContent('''
Expand Down
2 changes: 1 addition & 1 deletion tools/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ CHANNEL dev
MAJOR 3
MINOR 8
PATCH 0
PRERELEASE 14
PRERELEASE 15
PRERELEASE_PATCH 0

0 comments on commit 481a7fd

Please sign in to comment.