Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(606)

Unified Diff: pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart

Issue 1531473006: move functional argument check into manager (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart b/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart
index 795d0e9a727939ce0488cb6332a3a01dde8968bc..ec5cd4c21d2a9452af6976d8894e4fca1c904d5c 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart
@@ -231,9 +231,10 @@ class DartCompletionRequestImpl extends CompletionRequestImpl
unit = await new AnalysisFutureHelper<CompilationUnit>(context,
new LibrarySpecificUnit(libSource, source), RESOLVED_UNIT3)
.computeAsync();
+
}
- return new DartCompletionRequestImpl._(
+ DartCompletionRequestImpl dartRequest = new DartCompletionRequestImpl._(
request.context,
request.resourceProvider,
request.searchEngine,
@@ -241,5 +242,17 @@ class DartCompletionRequestImpl extends CompletionRequestImpl
request.source,
request.offset,
unit);
+
+ // Resolve the expression in which the completion occurs
+ // to properly determine if identifiers should be suggested
+ // rather than invocations.
+ if (dartRequest.target.maybeFunctionalArgument()) {
+ AstNode node = dartRequest.target.containingNode.parent;
+ if (node is Expression) {
+ await dartRequest.resolveExpression(node);
+ }
+ }
+
+ return dartRequest;
}
}

Powered by Google App Engine
This is Rietveld 408576698