Skip to content

Commit

Permalink
Fix issue autocompleting members on dynamic values in ng plugin.
Browse files Browse the repository at this point in the history
See angular issue #499 for a stack trace. When autocompleting a member
on dynamic, the member contributor checks to find a member definition
higher up in the tree that should lead to specific members to suggest.

However, in the angular plugin, the ASTs passed in are often fragments.
Account for the case where a node has no parent earlier than expected.

Change-Id: Ib30d9f1aef77241224f604c5994489aa9448b0c2
Reviewed-on: https://dart-review.googlesource.com/42884
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
  • Loading branch information
MichaelRFairhurst authored and commit-bot@chromium.org committed Feb 22, 2018
1 parent 9b71ba7 commit 7fdab0d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ abstract class LocalDeclarationVisitor extends GeneralizingAstVisitor {

@override
void visitNode(AstNode node) {
node.parent.accept(this);
// Support the case of searching partial ASTs by aborting on nodes with no
// parents. This is useful for the angular plugin.
node.parent?.accept(this);
}

@override
Expand Down

0 comments on commit 7fdab0d

Please sign in to comment.