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

Side by Side Diff: pkg/analysis_server/lib/src/services/completion/imported_computer.dart

Issue 803913003: fix named constructor completion (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
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 services.completion.computer.dart.toplevel; 5 library services.completion.computer.dart.toplevel;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analysis_server/src/protocol_server.dart' hide Element, 10 import 'package:analysis_server/src/protocol_server.dart' hide Element,
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 @override 160 @override
161 _ImportedSuggestionBuilder visitNode(AstNode node) { 161 _ImportedSuggestionBuilder visitNode(AstNode node) {
162 return null; 162 return null;
163 } 163 }
164 164
165 @override 165 @override
166 _ImportedSuggestionBuilder visitPrefixedIdentifier(PrefixedIdentifier node) { 166 _ImportedSuggestionBuilder visitPrefixedIdentifier(PrefixedIdentifier node) {
167 // Make suggestions for the prefix, but not for the selector 167 // Make suggestions for the prefix, but not for the selector
168 // InvocationComputer makes selector suggestions 168 // InvocationComputer makes selector suggestions
169 Token period = node.period; 169 Token period = node.period;
170 if (period != null && request.offset <= period.offset) { 170 if (period == null || request.offset <= period.offset) {
171 return new _ImportedSuggestionBuilder(request, excludeVoidReturn: true); 171 return new _ImportedSuggestionBuilder(request, excludeVoidReturn: true);
172 } 172 }
173 return null; 173 return null;
174 } 174 }
175 175
176 @override 176 @override
177 _ImportedSuggestionBuilder visitPropertyAccess(PropertyAccess node) { 177 _ImportedSuggestionBuilder visitPropertyAccess(PropertyAccess node) {
178 // Make suggestions for the target, but not for the property name 178 // Make suggestions for the target, but not for the property name
179 // InvocationComputer makes property name suggestions 179 // InvocationComputer makes property name suggestions
180 var operator = node.operator; 180 var operator = node.operator;
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 addFilteredSuggestions(cache.importedTypeSuggestions); 352 addFilteredSuggestions(cache.importedTypeSuggestions);
353 addFilteredSuggestions(cache.libraryPrefixSuggestions); 353 addFilteredSuggestions(cache.libraryPrefixSuggestions);
354 if (!typesOnly) { 354 if (!typesOnly) {
355 addFilteredSuggestions(cache.otherImportedSuggestions); 355 addFilteredSuggestions(cache.otherImportedSuggestions);
356 if (!excludeVoidReturn) { 356 if (!excludeVoidReturn) {
357 addFilteredSuggestions(cache.importedVoidReturnSuggestions); 357 addFilteredSuggestions(cache.importedVoidReturnSuggestions);
358 } 358 }
359 } 359 }
360 } 360 }
361 } 361 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698