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

Side by Side Diff: pkg/analysis_server/lib/src/provisional/completion/dart/completion.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
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 /** 5 /**
6 * Support for client code that extends the analysis server by adding new code 6 * Support for client code that extends the analysis server by adding new code
7 * completion contributors. 7 * Dart specific completion contributors.
Brian Wilkerson 2015/11/24 21:31:25 "new code Dart specific"? Remove "code"?
danrubel 2015/11/24 22:24:51 Done.
8 * 8 *
9 * Plugins can register completion contributors. The registered contributors 9 * Plugins can register Dart specific completion contributor factories.
10 * will be used to get completions any time a client issues a 10 * The registered contributor factoriess will be used to instantiate new
Brian Wilkerson 2015/11/24 21:31:25 "factoriess" --> "factories"
danrubel 2015/11/24 22:24:51 Done.
11 * 'completion.getSuggestions' request. 11 * contributors to get completions any time a client issues
12 * a 'completion.getSuggestions' request.
12 * 13 *
13 * If a plugin wants to add completions, it should implement the class 14 * If a plugin wants to add completions, it should implement the class
Brian Wilkerson 2015/11/24 21:31:25 "implement the class"? DartCompletionContributorFa
danrubel 2015/11/24 22:24:51 Good eyes. Fixed
14 * [CompletionContributor] and then register the contributor by including code 15 * [DartCompletionContributorFactory] and then register the contributor
15 * like the following in the plugin's registerExtensions method: 16 * by including code like the following in the plugin's
17 * registerExtensions method:
16 * 18 *
17 * @override 19 * @override
18 * void registerExtensions(RegisterExtension registerExtension) { 20 * void registerExtensions(RegisterExtension registerExtension) {
19 * ... 21 * ...
20 * registerExtension( 22 * registerExtension(
21 * COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID, 23 * DART_COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID,
22 * new MyCompletionContributor()); 24 * () => [new MyDartCompletionContributor()]);
Brian Wilkerson 2015/11/24 21:31:25 The documentation below (and the implementation of
danrubel 2015/11/24 22:24:51 As currently defined, the factory instantiates a l
23 * ... 25 * ...
24 * } 26 * }
25 */ 27 */
26 library analysis_server.src.provisional.completion.completion; 28 library analysis_server.src.provisional.completion.completion;
27 29
28 import 'package:analysis_server/src/plugin/server_plugin.dart'; 30 import 'package:analysis_server/src/plugin/server_plugin.dart';
29 import 'package:analysis_server/src/provisional/completion/completion_core.dart' ; 31 import 'package:analysis_server/src/provisional/completion/dart/completion_dart. dart';
30 import 'package:plugin/plugin.dart'; 32 import 'package:plugin/plugin.dart';
31 33
32 /** 34 /**
33 * The identifier of the extension point that allows plugins to register code 35 * The identifier of the extension point that allows plugins to register code
34 * completion contributors. The object used as an extension must be a 36 * completion contributors. The object used as an extension must be a
35 * [CompletionContributor]. 37 * [DartCompletionContributor].
36 */ 38 */
37 final String COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID = Plugin.join( 39 final String DART_COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID = Plugin.join(
38 ServerPlugin.UNIQUE_IDENTIFIER, 40 ServerPlugin.UNIQUE_IDENTIFIER,
39 ServerPlugin.COMPLETION_CONTRIBUTOR_EXTENSION_POINT); 41 ServerPlugin.DART_COMPLETION_CONTRIBUTOR_EXTENSION_POINT);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698