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

Unified Diff: pkg/analysis_server/lib/src/edit/edit_domain.dart

Issue 538583002: Integrate INLINE_METHOD into the server. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
« no previous file with comments | « no previous file | pkg/analysis_server/test/edit/refactoring_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/edit/edit_domain.dart
diff --git a/pkg/analysis_server/lib/src/edit/edit_domain.dart b/pkg/analysis_server/lib/src/edit/edit_domain.dart
index 470cdd6d4a9bc65ee4e576042d2664617d542a85..23ba92f3176dc77ad8f0e1a4eb3d451fcd811b10 100644
--- a/pkg/analysis_server/lib/src/edit/edit_domain.dart
+++ b/pkg/analysis_server/lib/src/edit/edit_domain.dart
@@ -257,6 +257,12 @@ class _RefactoringManager {
new ExtractMethodFeedback(offset, length, null, [], false, [], [], []);
}
}
+ if (kind == RefactoringKind.INLINE_METHOD) {
+ List<CompilationUnit> units = server.getResolvedCompilationUnits(file);
+ if (units.isNotEmpty) {
+ refactoring = new InlineMethodRefactoring(searchEngine, units[0], offset);
+ }
+ }
if (kind == RefactoringKind.RENAME) {
List<AstNode> nodes = server.getNodesAtOffset(file, offset);
List<Element> elements = server.getElementsAtOffset(file, offset);
@@ -305,7 +311,9 @@ class _RefactoringManager {
}
void _sendResultResponse() {
- result.feedback = feedback.toJson();
+ if (feedback != null) {
+ result.feedback = feedback.toJson();
+ }
// set problems
{
RefactoringStatus status = new RefactoringStatus();
@@ -344,6 +352,14 @@ class _RefactoringManager {
extractRefactoring.returnType = extractOptions.returnType;
return extractRefactoring.checkName();
}
+ if (refactoring is InlineMethodRefactoring) {
+ InlineMethodRefactoring inlineRefactoring = this.refactoring;
+ InlineMethodOptions inlineOptions =
+ new InlineMethodOptions.fromRefactoringParams(params, request);
+ inlineRefactoring.deleteSource = inlineOptions.deleteSource;
+ inlineRefactoring.inlineAll = inlineOptions.inlineAll;
+ return new RefactoringStatus();
+ }
if (refactoring is RenameRefactoring) {
RenameRefactoring renameRefactoring = refactoring;
RenameOptions renameOptions =
« no previous file with comments | « no previous file | pkg/analysis_server/test/edit/refactoring_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698