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

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

Issue 1012913002: Casted variable declarations for 'if (v is! Type)' should be declared after IfStatement. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 3bed9ab989b22baad6804a8d3253d43cdd1c7209..63287c4eb0fd4e96a9aa3b93a488db21167e9ab1 100644
--- a/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
@@ -802,10 +802,19 @@ class AssistProcessor {
_coverageMarker();
return;
}
+ // prepare location
+ int offset;
+ String statementPrefix;
+ if (isExpression.notOperator == null) {
+ offset = targetBlock.leftBracket.end;
+ statementPrefix = indent;
+ } else {
+ offset = targetBlock.rightBracket.end;
+ statementPrefix = '';
+ }
// prepare source
- int offset = targetBlock.leftBracket.end;
SourceBuilder builder = new SourceBuilder(file, offset);
- builder.append(eol + prefix + indent);
+ builder.append(eol + prefix + statementPrefix);
builder.append(castTypeCode);
// prepare excluded names
Set<String> excluded = new Set<String>();
« 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