| OLD | NEW |
| 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.local; | 5 library services.completion.computer.dart.local; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/protocol.dart' as protocol show Element, | 9 import 'package:analysis_server/src/protocol.dart' as protocol show Element, |
| 10 ElementKind; | 10 ElementKind; |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 } | 265 } |
| 266 } | 266 } |
| 267 | 267 |
| 268 CompletionSuggestion _addSuggestion(SimpleIdentifier id, TypeName returnType, | 268 CompletionSuggestion _addSuggestion(SimpleIdentifier id, TypeName returnType, |
| 269 ClassDeclaration classDecl, bool isDeprecated) { | 269 ClassDeclaration classDecl, bool isDeprecated) { |
| 270 if (id != null) { | 270 if (id != null) { |
| 271 String completion = id.name; | 271 String completion = id.name; |
| 272 if (completion != null && completion.length > 0 && completion != '_') { | 272 if (completion != null && completion.length > 0 && completion != '_') { |
| 273 CompletionSuggestion suggestion = new CompletionSuggestion( | 273 CompletionSuggestion suggestion = new CompletionSuggestion( |
| 274 CompletionSuggestionKind.INVOCATION, | 274 CompletionSuggestionKind.INVOCATION, |
| 275 isDeprecated ? CompletionRelevance.LOW : CompletionRelevance.DEFAULT
, | 275 isDeprecated ? COMPLETION_RELEVANCE_LOW : COMPLETION_RELEVANCE_DEFAU
LT, |
| 276 completion, | 276 completion, |
| 277 completion.length, | 277 completion.length, |
| 278 0, | 278 0, |
| 279 false, | 279 false, |
| 280 false); | 280 false); |
| 281 if (classDecl != null) { | 281 if (classDecl != null) { |
| 282 SimpleIdentifier identifier = classDecl.name; | 282 SimpleIdentifier identifier = classDecl.name; |
| 283 if (identifier != null) { | 283 if (identifier != null) { |
| 284 String name = identifier.name; | 284 String name = identifier.name; |
| 285 if (name != null && name.length > 0) { | 285 if (name != null && name.length > 0) { |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 if (name == null || name.length <= 0) { | 376 if (name == null || name.length <= 0) { |
| 377 return DYNAMIC; | 377 return DYNAMIC; |
| 378 } | 378 } |
| 379 TypeArgumentList typeArgs = type.typeArguments; | 379 TypeArgumentList typeArgs = type.typeArguments; |
| 380 if (typeArgs != null) { | 380 if (typeArgs != null) { |
| 381 //TODO (danrubel) include type arguments | 381 //TODO (danrubel) include type arguments |
| 382 } | 382 } |
| 383 return name; | 383 return name; |
| 384 } | 384 } |
| 385 } | 385 } |
| OLD | NEW |