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

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

Issue 1500793003: rework ArgListContributor to use new task model (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 library analysis_server.src.provisional.completion.dart.plugin; 5 library analysis_server.src.provisional.completion.dart.plugin;
6 6
7 import 'package:analysis_server/src/provisional/completion/completion.dart'; 7 import 'package:analysis_server/src/provisional/completion/completion.dart';
8 import 'package:analysis_server/src/provisional/completion/dart/completion.dart' ; 8 import 'package:analysis_server/src/provisional/completion/dart/completion.dart' ;
9 import 'package:analysis_server/src/provisional/completion/dart/completion_dart. dart'; 9 import 'package:analysis_server/src/provisional/completion/dart/completion_dart. dart';
10 import 'package:analysis_server/src/services/completion/dart/arglist_contributor .dart';
10 import 'package:analysis_server/src/services/completion/dart/completion_manager. dart'; 11 import 'package:analysis_server/src/services/completion/dart/completion_manager. dart';
11 import 'package:analysis_server/src/services/completion/dart/keyword_contributor .dart'; 12 import 'package:analysis_server/src/services/completion/dart/keyword_contributor .dart';
12 import 'package:plugin/plugin.dart'; 13 import 'package:plugin/plugin.dart';
13 14
14 /** 15 /**
15 * The shared dart completion plugin instance. 16 * The shared dart completion plugin instance.
16 */ 17 */
17 final DartCompletionPlugin dartCompletionPlugin = new DartCompletionPlugin(); 18 final DartCompletionPlugin dartCompletionPlugin = new DartCompletionPlugin();
18 19
19 class DartCompletionPlugin implements Plugin { 20 class DartCompletionPlugin implements Plugin {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // 59 //
59 // Register DartCompletionManager as a CompletionContributor 60 // Register DartCompletionManager as a CompletionContributor
60 // which delegates to all the DartCompletionContributors 61 // which delegates to all the DartCompletionContributors
61 // 62 //
62 registerExtension(COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID, 63 registerExtension(COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID,
63 () => new DartCompletionManager()); 64 () => new DartCompletionManager());
64 // 65 //
65 // Register the default DartCompletionContributors 66 // Register the default DartCompletionContributors
66 // 67 //
67 registerExtension(DART_COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID, 68 registerExtension(DART_COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID,
69 () => new ArgListContributor());
70 registerExtension(DART_COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID,
68 () => new KeywordContributor()); 71 () => new KeywordContributor());
69 } 72 }
70 73
71 /** 74 /**
72 * Validate the given extension by throwing an [ExtensionError] if it is not a 75 * Validate the given extension by throwing an [ExtensionError] if it is not a
73 * valid Dart specific completion contributor. 76 * valid Dart specific completion contributor.
74 */ 77 */
75 void _validateDartCompletionContributorExtension(Object extension) { 78 void _validateDartCompletionContributorExtension(Object extension) {
76 if (extension is! DartCompletionContributorFactory) { 79 if (extension is! DartCompletionContributorFactory) {
77 String id = _contributorExtensionPoint.uniqueIdentifier; 80 String id = _contributorExtensionPoint.uniqueIdentifier;
78 throw new ExtensionError( 81 throw new ExtensionError(
79 'Extensions to $id must be a DartCompletionContributorFactory'); 82 'Extensions to $id must be a DartCompletionContributorFactory');
80 } 83 }
81 } 84 }
82 } 85 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698