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

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

Issue 1008583002: Fix hints (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 | « pkg/analysis_server/lib/src/context_manager.dart ('k') | pkg/analyzer/lib/src/generated/ast.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/fix_internal.dart
diff --git a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
index 4a7dd19aa6cfb06555e7f3cdec4c24e6caf6a80b..a887ed69f0db5253e3c0d24a592a15292fc359bd 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
@@ -1088,8 +1088,10 @@ class FixProcessor {
if (prefix != null) {
SourceRange range = rf.rangeStartLength(node, 0);
_addReplaceEdit(range, '${prefix.displayName}.');
- _addFix(FixKind.IMPORT_LIBRARY_PREFIX,
- [libraryElement.displayName, prefix.displayName]);
+ _addFix(FixKind.IMPORT_LIBRARY_PREFIX, [
+ libraryElement.displayName,
+ prefix.displayName
+ ]);
continue;
}
// may be update "show" directive
@@ -1630,8 +1632,7 @@ class FixProcessor {
if (n is MethodInvocation &&
n.offset == errorOffset &&
n.length == errorLength) {
- MethodInvocation invocation = n as MethodInvocation;
- Expression target = invocation.target;
+ Expression target = n.target;
while (target is ParenthesizedExpression) {
target = (target as ParenthesizedExpression).expression;
}
@@ -1639,8 +1640,8 @@ class FixProcessor {
BinaryExpression binary = target as BinaryExpression;
_addReplaceEdit(rf.rangeToken(binary.operator), '~/');
// remove everything before and after
- _addRemoveEdit(rf.rangeStartStart(invocation, binary.leftOperand));
- _addRemoveEdit(rf.rangeEndEnd(binary.rightOperand, invocation));
+ _addRemoveEdit(rf.rangeStartStart(n, binary.leftOperand));
+ _addRemoveEdit(rf.rangeEndEnd(binary.rightOperand, n));
// add proposal
_addFix(FixKind.USE_EFFECTIVE_INTEGER_DIVISION, []);
// done
« no previous file with comments | « pkg/analysis_server/lib/src/context_manager.dart ('k') | pkg/analyzer/lib/src/generated/ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698