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

Side by Side Diff: pkg/analysis_server/test/services/completion/dart/completion_contributor_util.dart

Issue 2839273002: Named arg completion fixes (flutter-intellij#551) (Closed)
Patch Set: Created 3 years, 7 months 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library test.services.completion.dart.util; 5 library test.services.completion.dart.util;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/plugin/protocol/protocol.dart' as protocol 9 import 'package:analysis_server/plugin/protocol/protocol.dart' as protocol
10 show Element, ElementKind; 10 show Element, ElementKind;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 111
112 CompletionSuggestion assertSuggest(String completion, 112 CompletionSuggestion assertSuggest(String completion,
113 {CompletionSuggestionKind csKind: CompletionSuggestionKind.INVOCATION, 113 {CompletionSuggestionKind csKind: CompletionSuggestionKind.INVOCATION,
114 int relevance: DART_RELEVANCE_DEFAULT, 114 int relevance: DART_RELEVANCE_DEFAULT,
115 String importUri, 115 String importUri,
116 protocol.ElementKind elemKind: null, 116 protocol.ElementKind elemKind: null,
117 bool isDeprecated: false, 117 bool isDeprecated: false,
118 bool isPotential: false, 118 bool isPotential: false,
119 String elemFile, 119 String elemFile,
120 int elemOffset, 120 int elemOffset,
121 int selectionOffset,
121 String paramName, 122 String paramName,
122 String paramType, 123 String paramType,
123 String defaultArgListString: _UNCHECKED, 124 String defaultArgListString: _UNCHECKED,
124 List<int> defaultArgumentListTextRanges}) { 125 List<int> defaultArgumentListTextRanges}) {
125 CompletionSuggestion cs = 126 CompletionSuggestion cs =
126 getSuggest(completion: completion, csKind: csKind, elemKind: elemKind); 127 getSuggest(completion: completion, csKind: csKind, elemKind: elemKind);
127 if (cs == null) { 128 if (cs == null) {
128 failedCompletion('expected $completion $csKind $elemKind', suggestions); 129 failedCompletion('expected $completion $csKind $elemKind', suggestions);
129 } 130 }
130 expect(cs.kind, equals(csKind)); 131 expect(cs.kind, equals(csKind));
131 if (isDeprecated) { 132 if (isDeprecated) {
132 expect(cs.relevance, equals(DART_RELEVANCE_LOW)); 133 expect(cs.relevance, equals(DART_RELEVANCE_LOW));
133 } else { 134 } else {
134 expect(cs.relevance, equals(relevance), reason: completion); 135 expect(cs.relevance, equals(relevance), reason: completion);
135 } 136 }
136 expect(cs.importUri, importUri); 137 expect(cs.importUri, importUri);
137 expect(cs.selectionOffset, equals(completion.length)); 138 if (selectionOffset != null) {
danrubel 2017/04/27 14:04:14 This change will prevent cs.selectionOffset from b
pquitslund 2017/04/27 17:09:54 I need to pick this up in a follow-up CL. Net-net
139 expect(cs.selectionOffset, equals(selectionOffset));
140 }
138 expect(cs.selectionLength, equals(0)); 141 expect(cs.selectionLength, equals(0));
139 expect(cs.isDeprecated, equals(isDeprecated)); 142 expect(cs.isDeprecated, equals(isDeprecated));
140 expect(cs.isPotential, equals(isPotential)); 143 expect(cs.isPotential, equals(isPotential));
141 if (cs.element != null) { 144 if (cs.element != null) {
142 expect(cs.element.location, isNotNull); 145 expect(cs.element.location, isNotNull);
143 expect(cs.element.location.file, isNotNull); 146 expect(cs.element.location.file, isNotNull);
144 expect(cs.element.location.offset, isNotNull); 147 expect(cs.element.location.offset, isNotNull);
145 expect(cs.element.location.length, isNotNull); 148 expect(cs.element.location.length, isNotNull);
146 expect(cs.element.location.startColumn, isNotNull); 149 expect(cs.element.location.startColumn, isNotNull);
147 expect(cs.element.location.startLine, isNotNull); 150 expect(cs.element.location.startLine, isNotNull);
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 638
636 @override 639 @override
637 void setUp() { 640 void setUp() {
638 super.setUp(); 641 super.setUp();
639 index = createMemoryIndex(); 642 index = createMemoryIndex();
640 searchEngine = 643 searchEngine =
641 new SearchEngineImpl(index, (_) => new AstProviderForContext(context)); 644 new SearchEngineImpl(index, (_) => new AstProviderForContext(context));
642 contributor = createContributor(); 645 contributor = createContributor();
643 } 646 }
644 } 647 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698