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

Side by Side Diff: pkg/analysis_server/lib/src/provisional/completion/completion_dart.dart

Issue 1470373002: create new Dart specific completion contributor extension point (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 5 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
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library analysis_server.src.provisional.completion.completion_dart;
6
7 import 'dart:async';
8
9 import 'package:analysis_server/plugin/protocol/protocol.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';
12 import 'package:analyzer/src/generated/ast.dart';
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
34 /**
35 * An object used to produce completions
36 * at a specific location within a Dart file.
37 *
38 * Clients may implement this class when implementing plugins.
39 */
40 abstract class DartCompletionContributor {
41 /**
42 * Return a [Future] that completes with a list of suggestions
43 * for the given completion [request].
44 */
45 Future<List<CompletionSuggestion>> computeSuggestions(
46 DartCompletionRequest request);
47 }
48
49 /**
50 * The information about a requested list of completions within a Dart file.
51 *
52 * Clients may not extend, implement or mix-in this class.
53 */
54 abstract class DartCompletionRequest extends CompletionRequest {
55 /**
56 * Return the completion target. This determines what part of the parse tree
57 * will receive the newly inserted text.
58 */
59 CompletionTarget get target;
60
61 /**
62 * Return a [Future] that completes with a compilation unit in which
63 * all declarations in all scopes containing [target] have been resolved.
64 * The [Future] may return `null` if the unit cannot be resolved
65 * (e.g. unlinked part file).
66 * Any information obtained from [target] prior to calling this method
67 * should be discarded as it may have changed.
68 */
69 Future<CompilationUnit> resolveDeclarationsInScope();
70 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698