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

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

Issue 815683002: support part file completions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 years, 12 months 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 | Annotate | Revision Log
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.computer.dart.toplevel; 5 library services.completion.computer.dart.toplevel;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analysis_server/src/protocol_server.dart' hide Element, 10 import 'package:analysis_server/src/protocol_server.dart' hide Element,
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 Future<bool> computeFull(AstNode node) { 86 Future<bool> computeFull(AstNode node) {
87 87
88 Future<bool> addSuggestions(_) { 88 Future<bool> addSuggestions(_) {
89 _addInheritedSuggestions(node); 89 _addInheritedSuggestions(node);
90 _addTopLevelSuggestions(); 90 _addTopLevelSuggestions();
91 return new Future.value(true); 91 return new Future.value(true);
92 } 92 }
93 93
94 Future future = null; 94 Future future = null;
95 if (!cache.isImportInfoCached(request.unit)) { 95 if (!cache.isImportInfoCached(request.unit)) {
96 future = cache.computeImportInfo(request.unit, request.searchEngine); 96 future = cache.computeImportInfo(
97 request.unit,
98 request.searchEngine,
99 shouldWaitForLowPrioritySuggestions);
97 } 100 }
98 if (future != null && shouldWaitForLowPrioritySuggestions) { 101 if (future != null) {
99 return future.then(addSuggestions); 102 return future.then(addSuggestions);
100 } 103 }
101 return addSuggestions(true); 104 return addSuggestions(true);
102 } 105 }
103 106
104 /** 107 /**
105 * Add imported element suggestions. 108 * Add imported element suggestions.
106 */ 109 */
107 void _addElementSuggestions(List<Element> elements) { 110 void _addElementSuggestions(List<Element> elements) {
108 elements.forEach((Element elem) { 111 elements.forEach((Element elem) {
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 addFilteredSuggestions(cache.importedTypeSuggestions); 194 addFilteredSuggestions(cache.importedTypeSuggestions);
192 addFilteredSuggestions(cache.libraryPrefixSuggestions); 195 addFilteredSuggestions(cache.libraryPrefixSuggestions);
193 if (!typesOnly) { 196 if (!typesOnly) {
194 addFilteredSuggestions(cache.otherImportedSuggestions); 197 addFilteredSuggestions(cache.otherImportedSuggestions);
195 if (!excludeVoidReturn) { 198 if (!excludeVoidReturn) {
196 addFilteredSuggestions(cache.importedVoidReturnSuggestions); 199 addFilteredSuggestions(cache.importedVoidReturnSuggestions);
197 } 200 }
198 } 201 }
199 } 202 }
200 } 203 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698