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; |
} |
} |