| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import 'dart:async'; | 5 import 'dart:async'; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/services/correction/status.dart'; | 7 import 'package:analysis_server/src/services/correction/status.dart'; |
| 8 import 'package:analysis_server/src/services/refactoring/refactoring.dart'; | 8 import 'package:analysis_server/src/services/refactoring/refactoring.dart'; |
| 9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
| 10 import 'package:analyzer_plugin/protocol/protocol_common.dart' hide ElementKind; | 10 import 'package:analyzer_plugin/protocol/protocol_common.dart' hide ElementKind; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 main(A a, B b, C c, D d) { | 80 main(A a, B b, C c, D d) { |
| 81 var va = a.test(); | 81 var va = a.test(); |
| 82 var vb = b.test(); | 82 var vb = b.test(); |
| 83 var vc = c.test(); | 83 var vc = c.test(); |
| 84 var vd = d.test(); | 84 var vd = d.test(); |
| 85 } | 85 } |
| 86 '''); | 86 '''); |
| 87 } | 87 } |
| 88 | 88 |
| 89 test_change_multipleFiles() async { | 89 test_change_multipleFiles() async { |
| 90 await indexUnit( | 90 await indexUnit('/other.dart', r''' |
| 91 '/other.dart', | |
| 92 r''' | |
| 93 class A { | 91 class A { |
| 94 int get test => 1; | 92 int get test => 1; |
| 95 } | 93 } |
| 96 '''); | 94 '''); |
| 97 await indexTestUnit(''' | 95 await indexTestUnit(''' |
| 98 import 'other.dart'; | 96 import 'other.dart'; |
| 99 class B extends A { | 97 class B extends A { |
| 100 int get test => 2; | 98 int get test => 2; |
| 101 } | 99 } |
| 102 main(A a, B b) { | 100 main(A a, B b) { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 void _createRefactoringForElement(ExecutableElement element) { | 154 void _createRefactoringForElement(ExecutableElement element) { |
| 157 refactoring = new ConvertGetterToMethodRefactoring( | 155 refactoring = new ConvertGetterToMethodRefactoring( |
| 158 searchEngine, astProvider, element); | 156 searchEngine, astProvider, element); |
| 159 } | 157 } |
| 160 | 158 |
| 161 void _createRefactoringForString(String search) { | 159 void _createRefactoringForString(String search) { |
| 162 ExecutableElement element = findNodeElementAtString(search); | 160 ExecutableElement element = findNodeElementAtString(search); |
| 163 _createRefactoringForElement(element); | 161 _createRefactoringForElement(element); |
| 164 } | 162 } |
| 165 } | 163 } |
| OLD | NEW |