Skip to content

Commit 920ddae

Browse files
jwrencommit-bot@chromium.org
authored andcommitted
Re-write of the computation of the context type for code completion.  Instead of passing a parent and child node, a parent node with an offset is passed.  The primary purpose of this change was to fix a bug with argument lists which is close to being fixed.
I will follow up with some additional fixes and tests for map and list literals. Change-Id: I1a26e8f900dcf13402385a49e8f3538c5d1b39df Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151030 Commit-Queue: Jaime Wren <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent 459255a commit 920ddae

File tree

6 files changed

+275
-71
lines changed

6 files changed

+275
-71
lines changed

pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,9 +429,8 @@ class DartCompletionRequestImpl implements DartCompletionRequest {
429429
DartType get contextType {
430430
if (!_hasComputedContextType) {
431431
var entity = target.entity;
432-
if (entity is AstNode) {
433-
_contextType = featureComputer.computeContextType(entity);
434-
}
432+
_contextType = featureComputer.computeContextType(
433+
target.containingNode, entity.offset);
435434
_hasComputedContextType = true;
436435
}
437436
return _contextType;

0 commit comments

Comments
 (0)