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

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

Issue 832343002: fix top level getter suggestions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 years, 11 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
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/completion/completion_test_util.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.local; 5 library services.completion.computer.dart.local;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/protocol.dart' as protocol show Element, 9 import 'package:analysis_server/src/protocol.dart' as protocol show Element,
10 ElementKind; 10 ElementKind;
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 if (typesOnly) { 127 if (typesOnly) {
128 return; 128 return;
129 } 129 }
130 if (excludeVoidReturn && _isVoid(declaration.returnType)) { 130 if (excludeVoidReturn && _isVoid(declaration.returnType)) {
131 return; 131 return;
132 } 132 }
133 bool isDeprecated = _isDeprecated(declaration); 133 bool isDeprecated = _isDeprecated(declaration);
134 CompletionSuggestion suggestion = 134 CompletionSuggestion suggestion =
135 _addSuggestion(declaration.name, declaration.returnType, null, isDepreca ted); 135 _addSuggestion(declaration.name, declaration.returnType, null, isDepreca ted);
136 if (suggestion != null) { 136 if (suggestion != null) {
137 FormalParameterList param = declaration.functionExpression.parameters;
138 protocol.ElementKind kind;
139 if (declaration.isGetter) {
140 kind = protocol.ElementKind.GETTER;
141 } else if (declaration.isSetter) {
142 kind = protocol.ElementKind.SETTER;
143 } else {
144 kind = protocol.ElementKind.FUNCTION;
145 }
137 suggestion.element = _createElement( 146 suggestion.element = _createElement(
138 protocol.ElementKind.FUNCTION, 147 kind,
139 declaration.name, 148 declaration.name,
140 declaration.functionExpression.parameters.toSource(), 149 param != null ? param.toSource() : null,
141 declaration.returnType, 150 declaration.returnType,
142 false, 151 false,
143 isDeprecated); 152 isDeprecated);
144 } 153 }
145 } 154 }
146 155
147 @override 156 @override
148 void declaredFunctionTypeAlias(FunctionTypeAlias declaration) { 157 void declaredFunctionTypeAlias(FunctionTypeAlias declaration) {
149 bool isDeprecated = _isDeprecated(declaration); 158 bool isDeprecated = _isDeprecated(declaration);
150 CompletionSuggestion suggestion = 159 CompletionSuggestion suggestion =
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 if (name == null || name.length <= 0) { 375 if (name == null || name.length <= 0) {
367 return DYNAMIC; 376 return DYNAMIC;
368 } 377 }
369 TypeArgumentList typeArgs = type.typeArguments; 378 TypeArgumentList typeArgs = type.typeArguments;
370 if (typeArgs != null) { 379 if (typeArgs != null) {
371 //TODO (danrubel) include type arguments 380 //TODO (danrubel) include type arguments
372 } 381 }
373 return name; 382 return name;
374 } 383 }
375 } 384 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/completion/completion_test_util.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698