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

Unified Diff: pkg/analysis_server/lib/src/services/refactoring/extract_method.dart

Issue 574573002: Add SourceFileEdit.time field. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: tweak Created 6 years, 3 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
Index: pkg/analysis_server/lib/src/services/refactoring/extract_method.dart
diff --git a/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart b/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart
index d76aa53afc809677d946a18256b48902886ca703..8d9529469274c57ab782654fd4016a46caeaeab6 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart
@@ -61,7 +61,7 @@ class ExtractMethodRefactoringImpl extends RefactoringImpl implements
final CompilationUnit unit;
final int selectionOffset;
final int selectionLength;
- String file;
+ CompilationUnitElement unitElement;
SourceRange selectionRange;
CorrectionUtils utils;
@@ -91,7 +91,7 @@ class ExtractMethodRefactoringImpl extends RefactoringImpl implements
ExtractMethodRefactoringImpl(this.searchEngine, this.unit,
this.selectionOffset, this.selectionLength) {
- file = unit.element.source.fullName;
+ unitElement = unit.element;
selectionRange = new SourceRange(selectionOffset, selectionLength);
utils = new CorrectionUtils(unit);
}
@@ -276,7 +276,7 @@ class ExtractMethodRefactoringImpl extends RefactoringImpl implements
}
// add replace edit
SourceEdit edit = new SourceEdit.range(range, invocationSource);
- change.addEdit(file, edit);
+ addElementSourceChange(change, unitElement, edit);
}
// add method declaration
{
@@ -333,7 +333,7 @@ class ExtractMethodRefactoringImpl extends RefactoringImpl implements
int offset = _parentMember.end;
SourceEdit edit =
new SourceEdit(offset, 0, '${eol}${eol}${prefix}${declarationSource}');
- change.addEdit(file, edit);
+ addElementSourceChange(change, unitElement, edit);
}
}
// done

Powered by Google App Engine
This is Rietveld 408576698