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

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

Issue 690793004: make deprecated elements have low suggestion relevance (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 6 years, 1 month 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
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/completion/local_computer.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8
9 import 'package:analysis_server/src/protocol_server.dart' hide Element, 9 import 'package:analysis_server/src/protocol_server.dart' hide Element,
10 ElementKind; 10 ElementKind;
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 } 217 }
218 } 218 }
219 } 219 }
220 if (typesOnly && element is! ClassElement) { 220 if (typesOnly && element is! ClassElement) {
221 return; 221 return;
222 } 222 }
223 223
224 String completion = element.displayName; 224 String completion = element.displayName;
225 CompletionSuggestion suggestion = new CompletionSuggestion( 225 CompletionSuggestion suggestion = new CompletionSuggestion(
226 CompletionSuggestionKind.INVOCATION, 226 CompletionSuggestionKind.INVOCATION,
227 relevance, 227 element.isDeprecated ? CompletionRelevance.LOW : relevance,
228 completion, 228 completion,
229 completion.length, 229 completion.length,
230 0, 230 0,
231 element.isDeprecated, 231 element.isDeprecated,
232 false); 232 false);
233 233
234 suggestion.element = newElement_fromEngine(element); 234 suggestion.element = newElement_fromEngine(element);
235 235
236 DartType type; 236 DartType type;
237 if (element is FunctionElement) { 237 if (element is FunctionElement) {
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 importElem.isDeprecated, 388 importElem.isDeprecated,
389 false); 389 false);
390 LibraryElement lib = importElem.importedLibrary; 390 LibraryElement lib = importElem.importedLibrary;
391 if (lib != null) { 391 if (lib != null) {
392 suggestion.element = newElement_fromEngine(lib); 392 suggestion.element = newElement_fromEngine(lib);
393 } 393 }
394 request.suggestions.add(suggestion); 394 request.suggestions.add(suggestion);
395 } 395 }
396 } 396 }
397 } 397 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/completion/local_computer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698