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

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

Issue 591083003: Integrate CONVERT_METHOD_TO_GETTER 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 4f40bbaef26b800d2340432bf63af1c2612697ae..bf27d38ecea81006b96bebd2347968d9214e22c3 100644
--- a/pkg/analysis_server/lib/src/edit/edit_domain.dart
+++ b/pkg/analysis_server/lib/src/edit/edit_domain.dart
@@ -195,7 +195,8 @@ class _RefactoringManager {
* Checks if [refactoring] requires options.
*/
bool get _requiresOptions {
- if (refactoring is InlineLocalRefactoring) {
+ if (refactoring is ConvertMethodToGetterRefactoring ||
+ refactoring is InlineLocalRefactoring) {
return false;
}
return true;
@@ -265,6 +266,16 @@ class _RefactoringManager {
this.offset = offset;
this.length = length;
// create a new Refactoring instance
+ if (kind == RefactoringKind.CONVERT_METHOD_TO_GETTER) {
+ List<Element> elements = server.getElementsAtOffset(file, offset);
+ if (elements.isNotEmpty) {
+ Element element = elements[0];
+ if (element is ExecutableElement) {
+ refactoring =
+ new ConvertMethodToGetterRefactoring(searchEngine, element);
+ }
+ }
+ }
if (kind == RefactoringKind.EXTRACT_LOCAL_VARIABLE) {
List<CompilationUnit> units = server.getResolvedCompilationUnits(file);
if (units.isNotEmpty) {
« 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