| 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 library test.services.correction.fix; | 5 library test.services.correction.fix; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/plugin/edit/fix/fix_core.dart'; | 9 import 'package:analysis_server/plugin/edit/fix/fix_core.dart'; |
| 10 import 'package:analysis_server/plugin/edit/fix/fix_dart.dart'; | 10 import 'package:analysis_server/plugin/edit/fix/fix_dart.dart'; |
| (...skipping 2109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2120 await assertHasFix( | 2120 await assertHasFix( |
| 2121 DartFixKind.CREATE_LOCAL_VARIABLE, | 2121 DartFixKind.CREATE_LOCAL_VARIABLE, |
| 2122 ''' | 2122 ''' |
| 2123 main() { | 2123 main() { |
| 2124 int test; | 2124 int test; |
| 2125 test += 42; | 2125 test += 42; |
| 2126 } | 2126 } |
| 2127 '''); | 2127 '''); |
| 2128 } | 2128 } |
| 2129 | 2129 |
| 2130 test_createMissingOverrides_field_untyped() async { |
| 2131 resolveTestUnit(''' |
| 2132 class A { |
| 2133 var f; |
| 2134 } |
| 2135 |
| 2136 class B implements A { |
| 2137 } |
| 2138 '''); |
| 2139 await assertHasFix( |
| 2140 DartFixKind.CREATE_MISSING_OVERRIDES, |
| 2141 ''' |
| 2142 class A { |
| 2143 var f; |
| 2144 } |
| 2145 |
| 2146 class B implements A { |
| 2147 var f; |
| 2148 } |
| 2149 '''); |
| 2150 } |
| 2151 |
| 2130 test_createMissingOverrides_functionTypeAlias() async { | 2152 test_createMissingOverrides_functionTypeAlias() async { |
| 2131 resolveTestUnit(''' | 2153 resolveTestUnit(''' |
| 2132 typedef int Binary(int left, int right); | 2154 typedef int Binary(int left, int right); |
| 2133 | 2155 |
| 2134 abstract class Emulator { | 2156 abstract class Emulator { |
| 2135 void performBinary(Binary binary); | 2157 void performBinary(Binary binary); |
| 2136 } | 2158 } |
| 2137 | 2159 |
| 2138 class MyEmulator extends Emulator { | 2160 class MyEmulator extends Emulator { |
| 2139 } | 2161 } |
| (...skipping 2792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4932 int offset = resultCode.indexOf(search); | 4954 int offset = resultCode.indexOf(search); |
| 4933 positions.add(new Position(testFile, offset)); | 4955 positions.add(new Position(testFile, offset)); |
| 4934 } | 4956 } |
| 4935 return positions; | 4957 return positions; |
| 4936 } | 4958 } |
| 4937 | 4959 |
| 4938 void _performAnalysis() { | 4960 void _performAnalysis() { |
| 4939 while (context.performAnalysisTask().hasMoreWork); | 4961 while (context.performAnalysisTask().hasMoreWork); |
| 4940 } | 4962 } |
| 4941 } | 4963 } |
| OLD | NEW |