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

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

Issue 803913003: fix named constructor completion (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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 082260d4910f0af36626faa9deac0ef0ec8e7a7f..c120c56501e3f80f1806b3880d20c30a70b6e8f8 100644
--- a/pkg/analysis_server/lib/src/services/completion/local_computer.dart
+++ b/pkg/analysis_server/lib/src/services/completion/local_computer.dart
@@ -266,6 +266,16 @@ class _LocalVisitor extends LocalDeclarationVisitor {
}
@override
+ visitConstructorName(ConstructorName node) {
+ // InvocationComputer adds suggestions for prefixed elements
+ // but this computer adds suggestions for the prefix itself
+ Token period = node.period;
+ if (period == null || request.offset <= period.offset) {
+ visitNode(node);
+ }
+ }
+
+ @override
visitMethodInvocation(MethodInvocation node) {
// InvocationComputer adds suggestions for method selector
Token period = node.period;
@@ -288,8 +298,8 @@ class _LocalVisitor extends LocalDeclarationVisitor {
visitPrefixedIdentifier(PrefixedIdentifier node) {
// InvocationComputer adds suggestions for prefixed elements
// but this computer adds suggestions for the prefix itself
- SimpleIdentifier prefix = node.prefix;
- if (prefix == null || request.offset <= prefix.end) {
+ Token period = node.period;
+ if (period == null || request.offset <= period.offset) {
visitNode(node);
}
}

Powered by Google App Engine
This is Rietveld 408576698