| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 analysis_server.src.provisional.completion.completion_dart; | 5 library analysis_server.src.provisional.completion.completion_dart; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; | 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
| 10 import 'package:analysis_server/src/provisional/completion/completion_core.dart'
; | 10 import 'package:analysis_server/src/provisional/completion/completion_core.dart'
; |
| 11 import 'package:analysis_server/src/provisional/completion/dart/completion_targe
t.dart'; | 11 import 'package:analysis_server/src/provisional/completion/dart/completion_targe
t.dart'; |
| 12 import 'package:analyzer/src/generated/ast.dart'; | 12 import 'package:analyzer/src/generated/ast.dart'; |
| 13 | 13 |
| 14 export 'package:analysis_server/src/provisional/completion/completion_core.dart' |
| 15 show EMPTY_LIST; |
| 16 |
| 17 const int DART_RELEVANCE_COMMON_USAGE = 1200; |
| 18 const int DART_RELEVANCE_DEFAULT = 1000; |
| 19 const int DART_RELEVANCE_HIGH = 2000; |
| 20 const int DART_RELEVANCE_INHERITED_ACCESSOR = 1057; |
| 21 const int DART_RELEVANCE_INHERITED_FIELD = 1058; |
| 22 const int DART_RELEVANCE_INHERITED_METHOD = 1057; |
| 23 const int DART_RELEVANCE_KEYWORD = 1055; |
| 24 const int DART_RELEVANCE_LOCAL_ACCESSOR = 1057; |
| 25 const int DART_RELEVANCE_LOCAL_FIELD = 1058; |
| 26 const int DART_RELEVANCE_LOCAL_FUNCTION = 1056; |
| 27 const int DART_RELEVANCE_LOCAL_METHOD = 1057; |
| 28 const int DART_RELEVANCE_LOCAL_TOP_LEVEL_VARIABLE = 1056; |
| 29 const int DART_RELEVANCE_LOCAL_VARIABLE = 1059; |
| 30 const int DART_RELEVANCE_LOW = 500; |
| 31 const int DART_RELEVANCE_NAMED_PARAMETER = 1060; |
| 32 const int DART_RELEVANCE_PARAMETER = 1059; |
| 33 |
| 14 /** | 34 /** |
| 15 * An object used to produce completions | 35 * An object used to produce completions |
| 16 * at a specific location within a Dart file. | 36 * at a specific location within a Dart file. |
| 17 * | 37 * |
| 18 * Clients may implement this class when implementing plugins. | 38 * Clients may implement this class when implementing plugins. |
| 19 */ | 39 */ |
| 20 abstract class DartCompletionContributor { | 40 abstract class DartCompletionContributor { |
| 21 /** | 41 /** |
| 22 * Return a [Future] that completes with a list of suggestions | 42 * Return a [Future] that completes with a list of suggestions |
| 23 * for the given completion [request]. | 43 * for the given completion [request]. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 41 /** | 61 /** |
| 42 * Return a [Future] that completes with a compilation unit in which | 62 * Return a [Future] that completes with a compilation unit in which |
| 43 * all declarations in all scopes containing [target] have been resolved. | 63 * all declarations in all scopes containing [target] have been resolved. |
| 44 * The [Future] may return `null` if the unit cannot be resolved | 64 * The [Future] may return `null` if the unit cannot be resolved |
| 45 * (e.g. unlinked part file). | 65 * (e.g. unlinked part file). |
| 46 * Any information obtained from [target] prior to calling this method | 66 * Any information obtained from [target] prior to calling this method |
| 47 * should be discarded as it may have changed. | 67 * should be discarded as it may have changed. |
| 48 */ | 68 */ |
| 49 Future<CompilationUnit> resolveDeclarationsInScope(); | 69 Future<CompilationUnit> resolveDeclarationsInScope(); |
| 50 } | 70 } |
| OLD | NEW |