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

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

Issue 682953003: add functional type alias 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/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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 _addFunctionSuggestion(declaration); 132 _addFunctionSuggestion(declaration);
133 } else if (declaration is TopLevelVariableDeclaration) { 133 } else if (declaration is TopLevelVariableDeclaration) {
134 _addTopLevelVarSuggestions(declaration.variables); 134 _addTopLevelVarSuggestions(declaration.variables);
135 } else if (declaration is ClassTypeAlias) { 135 } else if (declaration is ClassTypeAlias) {
136 _addSuggestion( 136 _addSuggestion(
137 declaration.name, 137 declaration.name,
138 CompletionSuggestionKind.CLASS_ALIAS, 138 CompletionSuggestionKind.CLASS_ALIAS,
139 null, 139 null,
140 null); 140 null);
141 } else if (declaration is FunctionTypeAlias) { 141 } else if (declaration is FunctionTypeAlias) {
142 _addSuggestion( 142 CompletionSuggestion suggestion = _addSuggestion(
143 declaration.name, 143 declaration.name,
144 CompletionSuggestionKind.FUNCTION_TYPE_ALIAS, 144 CompletionSuggestionKind.FUNCTION_TYPE_ALIAS,
145 declaration.returnType, 145 declaration.returnType,
146 null); 146 null);
147 if (suggestion != null) {
148 suggestion.element = _createElement(
149 protocol.ElementKind.FUNCTION_TYPE_ALIAS,
150 declaration.name,
151 null, // TODO (danrubel) determine parameters
152 NO_RETURN_TYPE, // TODO (danrubel) determine return type
153 true,
154 _isDeprecated(declaration.metadata));
155 }
147 } 156 }
148 }); 157 });
149 } 158 }
150 159
151 @override 160 @override
152 visitExpressionStatement(ExpressionStatement node) { 161 visitExpressionStatement(ExpressionStatement node) {
153 Expression expression = node.expression; 162 Expression expression = node.expression;
154 if (expression is SimpleIdentifier) { 163 if (expression is SimpleIdentifier) {
155 if (expression.end < request.offset) { 164 if (expression.end < request.offset) {
156 // TODO (danrubel) suggest possible names for variable declaration 165 // TODO (danrubel) suggest possible names for variable declaration
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 if (name == null || name.length <= 0) { 584 if (name == null || name.length <= 0) {
576 return DYNAMIC; 585 return DYNAMIC;
577 } 586 }
578 TypeArgumentList typeArgs = type.typeArguments; 587 TypeArgumentList typeArgs = type.typeArguments;
579 if (typeArgs != null) { 588 if (typeArgs != null) {
580 //TODO (danrubel) include type arguments 589 //TODO (danrubel) include type arguments
581 } 590 }
582 return name; 591 return name;
583 } 592 }
584 } 593 }
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