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

Unified Diff: pkg/analysis_server/lib/src/services/correction/assist_internal.dart

Issue 693193002: Support for 'Add Type Annotation' when selection if right after ';'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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/correction/assist_test.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/correction/assist_internal.dart
diff --git a/pkg/analysis_server/lib/src/services/correction/assist_internal.dart b/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
index 381b7b7874808c568e7ed458a9901773737e8856..177461db6e30ba724b0a4f701653b4f0f375280f 100644
--- a/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
@@ -210,6 +210,11 @@ class AssistProcessor {
}
void _addProposal_addTypeAnnotation_VariableDeclaration() {
+ AstNode node = this.node;
+ // check if "var v = 42;^"
+ if (node is VariableDeclarationStatement) {
+ node = (node as VariableDeclarationStatement).variables;
+ }
// prepare VariableDeclarationList
VariableDeclarationList declarationList =
node.getAncestor((node) => node is VariableDeclarationList);
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/correction/assist_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698