Skip to content

Commit

Permalink
Elements. Migrate lib/src/utilities/navigation/navigation_dart.dart
Browse files Browse the repository at this point in the history
Change-Id: Ia3a98eaa939c5efcf62d8f2c3490e92ee731ab6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403905
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
  • Loading branch information
scheglov authored and Commit Queue committed Jan 9, 2025
1 parent 4be4ec7 commit 2de8b5e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 0 additions & 1 deletion pkg/analyzer_plugin/analyzer_use_new_elements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
lib/src/utilities/completion/optype.dart
lib/src/utilities/navigation/navigation_dart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -485,11 +485,13 @@ class _DartNavigationComputerVisitor extends RecursiveAstVisitor<void> {

@override
void visitPartOfDirective(PartOfDirective node) {
// TODO(dantup): How to migrate this to new element model? How do we get
// the target element/fragment for a 'part of'?
if (node.element case ElementImpl element) {
computer._addRegionForElement(node.libraryName ?? node.uri, element);
}
var parentUnit = node.parent as CompilationUnit;
var parentFragment = parentUnit.declaredFragment;
computer._addRegionForFragment(
node.libraryName ?? node.uri,
parentFragment?.enclosingFragment,
);

super.visitPartOfDirective(node);
}

Expand Down

0 comments on commit 2de8b5e

Please sign in to comment.