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

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

Issue 1319753002: exclude instance suggestions in static context - fixes #22932 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 5 years, 3 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
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/completion/local_declaration_visitor.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.contributor.dart.toplevel; 5 library services.completion.contributor.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' 10 import 'package:analysis_server/src/protocol_server.dart'
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 } 180 }
181 } 181 }
182 }); 182 });
183 } 183 }
184 184
185 /** 185 /**
186 * Add suggestions for any inherited imported members. 186 * Add suggestions for any inherited imported members.
187 */ 187 */
188 void _addInheritedSuggestions(AstNode node) { 188 void _addInheritedSuggestions(AstNode node) {
189 var classDecl = node.getAncestor((p) => p is ClassDeclaration); 189 var classDecl = node.getAncestor((p) => p is ClassDeclaration);
190 if (classDecl is ClassDeclaration) { 190 if (classDecl is ClassDeclaration && !optype.inStaticMethodBody) {
191 // Build a list of inherited types that are imported 191 // Build a list of inherited types that are imported
192 // and include any inherited imported members 192 // and include any inherited imported members
193 List<String> inheritedTypes = new List<String>(); 193 List<String> inheritedTypes = new List<String>();
194 // local declarations are handled by the local reference contributor 194 // local declarations are handled by the local reference contributor
195 visitInheritedTypes(classDecl, importedTypeName: (String typeName) { 195 visitInheritedTypes(classDecl, importedTypeName: (String typeName) {
196 inheritedTypes.add(typeName); 196 inheritedTypes.add(typeName);
197 }); 197 });
198 HashSet<String> visited = new HashSet<String>(); 198 HashSet<String> visited = new HashSet<String>();
199 while (inheritedTypes.length > 0) { 199 while (inheritedTypes.length > 0) {
200 String name = inheritedTypes.removeLast(); 200 String name = inheritedTypes.removeLast();
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 _addFilteredSuggestions(filterText, cache.libraryPrefixSuggestions); 254 _addFilteredSuggestions(filterText, cache.libraryPrefixSuggestions);
255 } 255 }
256 if (optype.includeReturnValueSuggestions) { 256 if (optype.includeReturnValueSuggestions) {
257 _addFilteredSuggestions(filterText, cache.otherImportedSuggestions); 257 _addFilteredSuggestions(filterText, cache.otherImportedSuggestions);
258 } 258 }
259 if (optype.includeVoidReturnSuggestions) { 259 if (optype.includeVoidReturnSuggestions) {
260 _addFilteredSuggestions(filterText, cache.importedVoidReturnSuggestions); 260 _addFilteredSuggestions(filterText, cache.importedVoidReturnSuggestions);
261 } 261 }
262 } 262 }
263 } 263 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/completion/local_declaration_visitor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698