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

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

Issue 1047673005: Use parsed unit/class nodes instead of resolved in fixes. (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/lib/src/services/correction/util.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 64fb1d6d92e4f0ae02c78c61ad5a4f7454740fc4..bd6c42af7f25841d4c35096e087e3c1bbc5d0d0f 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
@@ -450,7 +450,7 @@ class FixProcessor {
}
ClassElement targetElement = targetType.element as ClassElement;
String targetFile = targetElement.source.fullName;
- ClassDeclaration targetClass = targetElement.node;
+ ClassDeclaration targetClass = getParsedClassElementNode(targetElement);
_ConstructorLocation targetLocation =
_prepareNewConstructorLocation(targetClass);
// build method source
@@ -504,7 +504,7 @@ class FixProcessor {
}
ClassElement targetElement = targetType.element as ClassElement;
String targetFile = targetElement.source.fullName;
- ClassDeclaration targetClass = targetElement.node;
+ ClassDeclaration targetClass = getParsedClassElementNode(targetElement);
_ConstructorLocation targetLocation =
_prepareNewConstructorLocation(targetClass);
// build method source
@@ -716,7 +716,7 @@ class FixProcessor {
}
utils.targetClassElement = targetClassElement;
// prepare target ClassDeclaration
- AstNode targetTypeNode = targetClassElement.node;
+ AstNode targetTypeNode = getParsedClassElementNode(targetClassElement);
if (targetTypeNode is! ClassDeclaration) {
return;
}
@@ -849,7 +849,7 @@ class FixProcessor {
}
utils.targetClassElement = targetClassElement;
// prepare target ClassDeclaration
- AstNode targetTypeNode = targetClassElement.node;
+ AstNode targetTypeNode = getParsedClassElementNode(targetClassElement);
if (targetTypeNode is! ClassDeclaration) {
return;
}
@@ -1132,7 +1132,7 @@ class FixProcessor {
void _addFix_importLibrary(FixKind kind, String importPath) {
CompilationUnitElement libraryUnitElement =
unitLibraryElement.definingCompilationUnit;
- CompilationUnit libraryUnit = libraryUnitElement.node;
+ CompilationUnit libraryUnit = getParsedUnit(libraryUnitElement);
// prepare new import location
int offset = 0;
String prefix;
@@ -1664,7 +1664,8 @@ class FixProcessor {
staticModifier = target.bestElement.kind == ElementKind.CLASS;
}
// prepare insert offset
- ClassDeclaration targetClassNode = targetClassElement.node;
+ ClassDeclaration targetClassNode =
+ getParsedClassElementNode(targetClassElement);
prefix = ' ';
insertOffset = targetClassNode.end - 1;
if (targetClassNode.members.isEmpty) {
@@ -1976,7 +1977,8 @@ class FixProcessor {
// prepare environment
Source targetSource = targetClassElement.source;
// prepare insert offset
- ClassDeclaration targetClassNode = targetClassElement.node;
+ ClassDeclaration targetClassNode =
+ getParsedClassElementNode(targetClassElement);
int insertOffset = targetClassNode.end - 1;
// prepare prefix
String prefix = ' ';
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/correction/util.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698