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

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

Issue 1267203002: add location to suggestions from local file (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 services.completion.contributor.dart.invocation; 5 library services.completion.contributor.dart.invocation;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/services/completion/dart_completion_manager. dart'; 9 import 'package:analysis_server/src/services/completion/dart_completion_manager. dart';
10 import 'package:analysis_server/src/services/completion/local_declaration_visito r.dart'; 10 import 'package:analysis_server/src/services/completion/local_declaration_visito r.dart';
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 constructorDecl.getAncestor((p) => p is ClassDeclaration); 130 constructorDecl.getAncestor((p) => p is ClassDeclaration);
131 for (ClassMember member in classDecl.members) { 131 for (ClassMember member in classDecl.members) {
132 if (member is FieldDeclaration) { 132 if (member is FieldDeclaration) {
133 for (VariableDeclaration varDecl in member.fields.variables) { 133 for (VariableDeclaration varDecl in member.fields.variables) {
134 SimpleIdentifier fieldId = varDecl.name; 134 SimpleIdentifier fieldId = varDecl.name;
135 if (fieldId != null) { 135 if (fieldId != null) {
136 String fieldName = fieldId.name; 136 String fieldName = fieldId.name;
137 if (fieldName != null && fieldName.length > 0) { 137 if (fieldName != null && fieldName.length > 0) {
138 if (!referencedFields.contains(fieldName)) { 138 if (!referencedFields.contains(fieldName)) {
139 CompletionSuggestion suggestion = 139 CompletionSuggestion suggestion =
140 createFieldSuggestion(member, varDecl); 140 createFieldSuggestion(request.source, member, varDecl);
141 if (suggestion != null) { 141 if (suggestion != null) {
142 request.addSuggestion(suggestion); 142 request.addSuggestion(suggestion);
143 } 143 }
144 } 144 }
145 } 145 }
146 } 146 }
147 } 147 }
148 } 148 }
149 } 149 }
150 } 150 }
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 } 429 }
430 return new Future.value(false); 430 return new Future.value(false);
431 } 431 }
432 432
433 @override 433 @override
434 Future<bool> visitVariableElement(VariableElement element) { 434 Future<bool> visitVariableElement(VariableElement element) {
435 InterfaceTypeSuggestionBuilder.suggestionsFor(request, element.type); 435 InterfaceTypeSuggestionBuilder.suggestionsFor(request, element.type);
436 return new Future.value(true); 436 return new Future.value(true);
437 } 437 }
438 } 438 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698