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

Side by Side Diff: pkg/analysis_server/test/services/correction/fix_test.dart

Issue 1705283002: Add @override when implement missing overrides for fields. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/fix_internal.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2126 matching lines...) Expand 10 before | Expand all | Expand 10 after
2137 } 2137 }
2138 '''); 2138 ''');
2139 await assertHasFix( 2139 await assertHasFix(
2140 DartFixKind.CREATE_MISSING_OVERRIDES, 2140 DartFixKind.CREATE_MISSING_OVERRIDES,
2141 ''' 2141 '''
2142 class A { 2142 class A {
2143 var f; 2143 var f;
2144 } 2144 }
2145 2145
2146 class B implements A { 2146 class B implements A {
2147 @override
2147 var f; 2148 var f;
2148 } 2149 }
2149 '''); 2150 ''');
2150 } 2151 }
2151 2152
2152 test_createMissingOverrides_functionTypeAlias() async { 2153 test_createMissingOverrides_functionTypeAlias() async {
2153 resolveTestUnit(''' 2154 resolveTestUnit('''
2154 typedef int Binary(int left, int right); 2155 typedef int Binary(int left, int right);
2155 2156
2156 abstract class Emulator { 2157 abstract class Emulator {
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
2329 await assertHasFix( 2330 await assertHasFix(
2330 DartFixKind.CREATE_MISSING_OVERRIDES, 2331 DartFixKind.CREATE_MISSING_OVERRIDES,
2331 ''' 2332 '''
2332 class A { 2333 class A {
2333 int ma; 2334 int ma;
2334 void mb() {} 2335 void mb() {}
2335 double mc; 2336 double mc;
2336 } 2337 }
2337 2338
2338 class B implements A { 2339 class B implements A {
2340 @override
2339 int ma; 2341 int ma;
2340 2342
2343 @override
2341 double mc; 2344 double mc;
2342 2345
2343 @override 2346 @override
2344 void mb() { 2347 void mb() {
2345 // TODO: implement mb 2348 // TODO: implement mb
2346 } 2349 }
2347 } 2350 }
2348 '''); 2351 ''');
2349 } 2352 }
2350 2353
(...skipping 2657 matching lines...) Expand 10 before | Expand all | Expand 10 after
5008 int offset = resultCode.indexOf(search); 5011 int offset = resultCode.indexOf(search);
5009 positions.add(new Position(testFile, offset)); 5012 positions.add(new Position(testFile, offset));
5010 } 5013 }
5011 return positions; 5014 return positions;
5012 } 5015 }
5013 5016
5014 void _performAnalysis() { 5017 void _performAnalysis() {
5015 while (context.performAnalysisTask().hasMoreWork); 5018 while (context.performAnalysisTask().hasMoreWork);
5016 } 5019 }
5017 } 5020 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/fix_internal.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698