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

Side by Side Diff: pkg/analysis_server/lib/src/services/completion/dart_completion_manager.dart

Issue 1526303003: convert ImportedReferenceContributor to new API (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) 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.dart; 5 library services.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 show AnalysisRequest, CompletionContributor, CompletionRequest; 11 show AnalysisRequest, CompletionContributor, CompletionRequest;
12 import 'package:analysis_server/src/provisional/completion/dart/completion_targe t.dart'; 12 import 'package:analysis_server/src/provisional/completion/dart/completion_targe t.dart';
13 import 'package:analysis_server/src/services/completion/completion_core.dart'; 13 import 'package:analysis_server/src/services/completion/completion_core.dart';
14 import 'package:analysis_server/src/services/completion/completion_manager.dart' ; 14 import 'package:analysis_server/src/services/completion/completion_manager.dart' ;
15 import 'package:analysis_server/src/services/completion/dart/common_usage_sorter .dart'; 15 import 'package:analysis_server/src/services/completion/dart/common_usage_sorter .dart';
16 import 'package:analysis_server/src/services/completion/dart/contribution_sorter .dart'; 16 import 'package:analysis_server/src/services/completion/dart/contribution_sorter .dart';
17 import 'package:analysis_server/src/services/completion/dart_completion_cache.da rt'; 17 import 'package:analysis_server/src/services/completion/dart_completion_cache.da rt';
18 import 'package:analysis_server/src/services/completion/imported_reference_contr ibutor.dart';
19 import 'package:analysis_server/src/services/completion/optype.dart'; 18 import 'package:analysis_server/src/services/completion/optype.dart';
20 import 'package:analysis_server/src/services/search/search_engine.dart'; 19 import 'package:analysis_server/src/services/search/search_engine.dart';
21 import 'package:analyzer/file_system/file_system.dart'; 20 import 'package:analyzer/file_system/file_system.dart';
22 import 'package:analyzer/src/generated/ast.dart'; 21 import 'package:analyzer/src/generated/ast.dart';
23 import 'package:analyzer/src/generated/engine.dart'; 22 import 'package:analyzer/src/generated/engine.dart';
24 import 'package:analyzer/src/generated/scanner.dart'; 23 import 'package:analyzer/src/generated/scanner.dart';
25 import 'package:analyzer/src/generated/source.dart'; 24 import 'package:analyzer/src/generated/source.dart';
26 25
27 export 'package:analysis_server/src/provisional/completion/dart/completion_dart. dart' 26 export 'package:analysis_server/src/provisional/completion/dart/completion_dart. dart'
28 show 27 show
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 DartCompletionManager( 85 DartCompletionManager(
87 AnalysisContext context, this.searchEngine, Source source, this.cache, 86 AnalysisContext context, this.searchEngine, Source source, this.cache,
88 [this.contributors, this.newContributors, this.contributionSorter]) 87 [this.contributors, this.newContributors, this.contributionSorter])
89 : super(context, source) { 88 : super(context, source) {
90 if (contributors == null) { 89 if (contributors == null) {
91 contributors = [ 90 contributors = [
92 // LocalReferenceContributor before ImportedReferenceContributor 91 // LocalReferenceContributor before ImportedReferenceContributor
93 // because local suggestions take precedence 92 // because local suggestions take precedence
94 // and can hide other suggestions with the same name 93 // and can hide other suggestions with the same name
95 //new LocalReferenceContributor(), 94 //new LocalReferenceContributor(),
96 new ImportedReferenceContributor(), 95 //new ImportedReferenceContributor(),
97 //new KeywordContributor(), 96 //new KeywordContributor(),
98 //new ArgListContributor(), 97 //new ArgListContributor(),
99 // new CombinatorContributor(), 98 // new CombinatorContributor(),
100 // new PrefixedElementContributor(), 99 // new PrefixedElementContributor(),
101 //new UriContributor(), 100 //new UriContributor(),
102 // TODO(brianwilkerson) Use the completion contributor extension point 101 // TODO(brianwilkerson) Use the completion contributor extension point
103 // to add the contributor below (and eventually, all the contributors). 102 // to add the contributor below (and eventually, all the contributors).
104 // new NewCompletionWrapper(new InheritedContributor()) 103 // new NewCompletionWrapper(new InheritedContributor())
105 ]; 104 ];
106 } 105 }
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 // Replacement range for import URI 478 // Replacement range for import URI
480 return new ReplacementRange(start, end - start); 479 return new ReplacementRange(start, end - start);
481 } 480 }
482 } 481 }
483 } 482 }
484 } 483 }
485 } 484 }
486 return new ReplacementRange(requestOffset, 0); 485 return new ReplacementRange(requestOffset, 0);
487 } 486 }
488 } 487 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698