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

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

Issue 2924633002: Remove unused IdeOptions (Closed)
Patch Set: reverse default Created 3 years, 6 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
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 import 'dart:async'; 5 import 'dart:async';
6 6
7 import 'package:analysis_server/src/provisional/completion/dart/completion_dart. dart'; 7 import 'package:analysis_server/src/provisional/completion/dart/completion_dart. dart';
8 import 'package:analysis_server/src/services/completion/dart/suggestion_builder. dart'; 8 import 'package:analysis_server/src/services/completion/dart/suggestion_builder. dart';
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/element/element.dart'; 10 import 'package:analyzer/dart/element/element.dart';
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 for (ImportElement importElem in imports) { 48 for (ImportElement importElem in imports) {
49 if (importElem.prefix?.name == elem.name) { 49 if (importElem.prefix?.name == elem.name) {
50 LibraryElement library = importElem.importedLibrary; 50 LibraryElement library = importElem.importedLibrary;
51 if (library != null) { 51 if (library != null) {
52 // Suggest elements from the imported library 52 // Suggest elements from the imported library
53 AstNode parent = request.target.containingNode.parent; 53 AstNode parent = request.target.containingNode.parent;
54 bool isConstructor = parent.parent is ConstructorName; 54 bool isConstructor = parent.parent is ConstructorName;
55 bool typesOnly = parent is TypeName; 55 bool typesOnly = parent is TypeName;
56 bool instCreation = typesOnly && isConstructor; 56 bool instCreation = typesOnly && isConstructor;
57 LibraryElementSuggestionBuilder builder = 57 LibraryElementSuggestionBuilder builder =
58 new LibraryElementSuggestionBuilder( 58 new LibraryElementSuggestionBuilder(containingLibrary,
59 containingLibrary, 59 CompletionSuggestionKind.INVOCATION, typesOnly, instCreation);
60 CompletionSuggestionKind.INVOCATION,
61 typesOnly,
62 instCreation,
63 request.ideOptions);
64 library.visitChildren(builder); 60 library.visitChildren(builder);
65 suggestions.addAll(builder.suggestions); 61 suggestions.addAll(builder.suggestions);
66 62
67 // If the import is 'deferred' then suggest 'loadLibrary' 63 // If the import is 'deferred' then suggest 'loadLibrary'
68 if (importElem.isDeferred) { 64 if (importElem.isDeferred) {
69 FunctionElement loadLibFunct = library.loadLibraryFunction; 65 FunctionElement loadLibFunct = library.loadLibraryFunction;
70 suggestions.add(createSuggestion(loadLibFunct, request.ideOptions)); 66 suggestions.add(createSuggestion(loadLibFunct));
71 } 67 }
72 } 68 }
73 } 69 }
74 } 70 }
75 return suggestions; 71 return suggestions;
76 } 72 }
77 } 73 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698