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

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

Issue 838053003: suggest fields rather than synthetic getters (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address comments 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
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 2e1aa9e20ce1df861a43fe4fd95f10fa62716948..d91af5aced507905873dfd0d495dbcd53cd93dd4 100644
--- a/pkg/analysis_server/lib/src/services/completion/local_computer.dart
+++ b/pkg/analysis_server/lib/src/services/completion/local_computer.dart
@@ -108,15 +108,15 @@ class _LocalVisitor extends LocalDeclarationVisitor {
bool isDeprecated = _isDeprecated(fieldDecl) || _isDeprecated(varDecl);
CompletionSuggestion suggestion = _addSuggestion(
varDecl.name,
- fieldDecl.fields.type,
+ null,
fieldDecl.parent,
isDeprecated);
if (suggestion != null) {
suggestion.element = _createElement(
- protocol.ElementKind.GETTER,
+ protocol.ElementKind.FIELD,
varDecl.name,
null,
- fieldDecl.fields.type,
+ null,
false,
isDeprecated);
}
@@ -265,7 +265,7 @@ class _LocalVisitor extends LocalDeclarationVisitor {
}
}
- CompletionSuggestion _addSuggestion(SimpleIdentifier id, TypeName typeName,
+ CompletionSuggestion _addSuggestion(SimpleIdentifier id, TypeName returnType,
ClassDeclaration classDecl, bool isDeprecated) {
if (id != null) {
String completion = id.name;
@@ -287,8 +287,8 @@ class _LocalVisitor extends LocalDeclarationVisitor {
}
}
}
- if (typeName != null) {
- Identifier identifier = typeName.name;
+ if (returnType != null) {
+ Identifier identifier = returnType.name;
if (identifier != null) {
String name = identifier.name;
if (name != null && name.length > 0) {

Powered by Google App Engine
This is Rietveld 408576698