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

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

Issue 829173003: Handle generic parameters correctly in invocation completions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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/invocation_computer.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/invocation_computer.dart b/pkg/analysis_server/lib/src/services/completion/invocation_computer.dart
index 348021e44d0aa382381cd3dd05af5fdb8040cb64..6d7dd95cd9865bf2291c88f94ebda6edee68cada 100644
--- a/pkg/analysis_server/lib/src/services/completion/invocation_computer.dart
+++ b/pkg/analysis_server/lib/src/services/completion/invocation_computer.dart
@@ -64,11 +64,8 @@ class _ExpressionSuggestionBuilder implements SuggestionBuilder {
node = (node as PropertyAccess).realTarget;
}
if (node is Expression) {
- DartType type = node.bestType;
- if (type != null) {
- ClassElementSuggestionBuilder.suggestionsFor(request, type.element);
- return new Future.value(true);
- }
+ InterfaceTypeSuggestionBuilder.suggestionsFor(request, node.bestType);
+ return new Future.value(true);
}
return new Future.value(false);
}
@@ -161,10 +158,9 @@ class _PrefixedIdentifierSuggestionBuilder extends
if (element != null) {
InterfaceType type = element.type;
if (type != null) {
- ClassElementSuggestionBuilder.suggestionsFor(
+ StaticClassElementSuggestionBuilder.suggestionsFor(
request,
- type.element,
- staticOnly: true);
+ type.element);
}
}
return new Future.value(false);
@@ -204,10 +200,7 @@ class _PrefixedIdentifierSuggestionBuilder extends
if (element != null) {
PropertyInducingElement elemVar = element.variable;
if (elemVar != null) {
- DartType type = elemVar.type;
- if (type != null) {
- ClassElementSuggestionBuilder.suggestionsFor(request, type.element);
- }
+ InterfaceTypeSuggestionBuilder.suggestionsFor(request, elemVar.type);
}
return new Future.value(true);
}
@@ -216,10 +209,7 @@ class _PrefixedIdentifierSuggestionBuilder extends
@override
Future<bool> visitVariableElement(VariableElement element) {
- DartType type = element.type;
- if (type != null) {
- ClassElementSuggestionBuilder.suggestionsFor(request, type.element);
- }
+ InterfaceTypeSuggestionBuilder.suggestionsFor(request, element.type);
return new Future.value(true);
}
}

Powered by Google App Engine
This is Rietveld 408576698