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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/completion/completion_test_util.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/services/completion/local_computer.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/local_computer.dart b/pkg/analysis_server/lib/src/services/completion/local_computer.dart
index 519b3c8d3143858c899d1e3ffd3f0c6dd79c7d84..e2059d01e93f84872300ec6d6db952a30d6c087d 100644
--- a/pkg/analysis_server/lib/src/services/completion/local_computer.dart
+++ b/pkg/analysis_server/lib/src/services/completion/local_computer.dart
@@ -134,10 +134,19 @@ class _LocalVisitor extends LocalDeclarationVisitor {
CompletionSuggestion suggestion =
_addSuggestion(declaration.name, declaration.returnType, null, isDeprecated);
if (suggestion != null) {
+ FormalParameterList param = declaration.functionExpression.parameters;
+ protocol.ElementKind kind;
+ if (declaration.isGetter) {
+ kind = protocol.ElementKind.GETTER;
+ } else if (declaration.isSetter) {
+ kind = protocol.ElementKind.SETTER;
+ } else {
+ kind = protocol.ElementKind.FUNCTION;
+ }
suggestion.element = _createElement(
- protocol.ElementKind.FUNCTION,
+ kind,
declaration.name,
- declaration.functionExpression.parameters.toSource(),
+ param != null ? param.toSource() : null,
declaration.returnType,
false,
isDeprecated);
« 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