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/invocation_computer.dart

Issue 686843003: add type static constants suggestions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/completion/suggestion_builder.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.computer.dart.invocation; 5 library services.completion.computer.dart.invocation;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/services/completion/dart_completion_manager. dart'; 9 import 'package:analysis_server/src/services/completion/dart_completion_manager. dart';
10 import 'package:analysis_server/src/services/completion/suggestion_builder.dart' ; 10 import 'package:analysis_server/src/services/completion/suggestion_builder.dart' ;
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 * An [Element] visitor for determining the appropriate invocation/access 129 * An [Element] visitor for determining the appropriate invocation/access
130 * suggestions based upon the element for which the completion is requested. 130 * suggestions based upon the element for which the completion is requested.
131 */ 131 */
132 class _InvocationElementVisitor extends GeneralizingElementVisitor<Future<bool>> 132 class _InvocationElementVisitor extends GeneralizingElementVisitor<Future<bool>>
133 { 133 {
134 final DartCompletionRequest request; 134 final DartCompletionRequest request;
135 135
136 _InvocationElementVisitor(this.request); 136 _InvocationElementVisitor(this.request);
137 137
138 @override 138 @override
139 Future<bool> visitClassElement(ClassElement element) {
140 if (element != null) {
141 InterfaceType type = element.type;
142 if (type != null) {
143 ClassElementSuggestionBuilder.staticSuggestionsFor(request, type.element );
144 }
145 }
146 return new Future.value(false);
147 }
148
149 @override
139 Future<bool> visitElement(Element element) { 150 Future<bool> visitElement(Element element) {
140 return new Future.value(false); 151 return new Future.value(false);
141 } 152 }
142 153
143 @override 154 @override
144 Future<bool> visitPrefixElement(PrefixElement element) { 155 Future<bool> visitPrefixElement(PrefixElement element) {
145 //TODO (danrubel) reimplement to use prefixElement.importedLibraries 156 //TODO (danrubel) reimplement to use prefixElement.importedLibraries
146 // once that accessor is implemented and available in Dart 157 // once that accessor is implemented and available in Dart
147 bool modified = false; 158 bool modified = false;
148 // Find the import directive with the given prefix 159 // Find the import directive with the given prefix
(...skipping 29 matching lines...) Expand all
178 189
179 @override 190 @override
180 Future<bool> visitVariableElement(VariableElement element) { 191 Future<bool> visitVariableElement(VariableElement element) {
181 DartType type = element.type; 192 DartType type = element.type;
182 if (type != null) { 193 if (type != null) {
183 ClassElementSuggestionBuilder.suggestionsFor(request, type.element); 194 ClassElementSuggestionBuilder.suggestionsFor(request, type.element);
184 } 195 }
185 return new Future.value(true); 196 return new Future.value(true);
186 } 197 }
187 } 198 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698