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

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

Issue 1121773003: Sort the containing method first in completions following super (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 years, 7 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/lib/src/services/completion/suggestion_builder.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/prefixed_element_contributor.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/prefixed_element_contributor.dart b/pkg/analysis_server/lib/src/services/completion/prefixed_element_contributor.dart
index 0e15afd9f9831b4bdd94f72596b86a2e35a49368..5abb208511d07e5d3d1a32f20af5d097326b6cfd 100644
--- a/pkg/analysis_server/lib/src/services/completion/prefixed_element_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/prefixed_element_contributor.dart
@@ -73,8 +73,20 @@ class _ExpressionSuggestionBuilder implements SuggestionBuilder {
}
}
if (node is Expression) {
+ String containingMethodName;
+ bool isSuper = node is SuperExpression;
+ if (isSuper) {
+ MethodDeclaration containingMethod =
+ node.getAncestor((p) => p is MethodDeclaration);
+ if (containingMethod != null) {
+ SimpleIdentifier id = containingMethod.name;
+ if (id != null) {
+ containingMethodName = id.name;
+ }
+ }
+ }
InterfaceTypeSuggestionBuilder.suggestionsFor(request, node.bestType,
- isSuper: node is SuperExpression);
+ isSuper: isSuper, containingMethodName: containingMethodName);
return new Future.value(true);
}
return new Future.value(false);
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698