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

Side by Side Diff: pkg/analyzer_plugin/test/plugin/fix_mixin_test.dart

Issue 2953093002: Update the plugin API (Closed)
Patch Set: Created 3 years, 5 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
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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:analyzer/dart/analysis/results.dart' hide AnalysisResult;
8 import 'package:analyzer/error/error.dart'; 7 import 'package:analyzer/error/error.dart';
9 import 'package:analyzer/file_system/file_system.dart'; 8 import 'package:analyzer/file_system/file_system.dart';
10 import 'package:analyzer/file_system/memory_file_system.dart'; 9 import 'package:analyzer/file_system/memory_file_system.dart';
11 import 'package:analyzer/src/dart/analysis/driver.dart'; 10 import 'package:analyzer/src/dart/analysis/driver.dart';
12 import 'package:analyzer/src/error/codes.dart'; 11 import 'package:analyzer/src/error/codes.dart';
13 import 'package:analyzer/src/generated/source.dart'; 12 import 'package:analyzer/src/generated/source.dart';
14 import 'package:analyzer_plugin/plugin/fix_mixin.dart'; 13 import 'package:analyzer_plugin/plugin/fix_mixin.dart';
15 import 'package:analyzer_plugin/protocol/protocol_common.dart' 14 import 'package:analyzer_plugin/protocol/protocol_common.dart'
16 hide AnalysisError; 15 hide AnalysisError;
17 import 'package:analyzer_plugin/protocol/protocol_generated.dart'; 16 import 'package:analyzer_plugin/protocol/protocol_generated.dart';
17 import 'package:analyzer_plugin/src/utilities/fixes/fixes.dart';
18 import 'package:analyzer_plugin/utilities/fixes/fixes.dart'; 18 import 'package:analyzer_plugin/utilities/fixes/fixes.dart';
19 import 'package:path/src/context.dart'; 19 import 'package:path/src/context.dart';
20 import 'package:test/test.dart'; 20 import 'package:test/test.dart';
21 import 'package:test_reflective_loader/test_reflective_loader.dart'; 21 import 'package:test_reflective_loader/test_reflective_loader.dart';
22 22
23 import 'mocks.dart'; 23 import 'mocks.dart';
24 24
25 void main() { 25 void main() {
26 defineReflectiveTests(FixesMixinTest); 26 defineReflectiveTests(FixesMixinTest);
27 } 27 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 @override 87 @override
88 List<FixContributor> getFixContributors(AnalysisDriverGeneric driver) { 88 List<FixContributor> getFixContributors(AnalysisDriverGeneric driver) {
89 return <FixContributor>[ 89 return <FixContributor>[
90 new _TestFixContributor(<PrioritizedSourceChange>[createChange()]), 90 new _TestFixContributor(<PrioritizedSourceChange>[createChange()]),
91 new _TestFixContributor( 91 new _TestFixContributor(
92 <PrioritizedSourceChange>[createChange(), createChange()]) 92 <PrioritizedSourceChange>[createChange(), createChange()])
93 ]; 93 ];
94 } 94 }
95 95
96 @override 96 @override
97 Future<ResolveResult> getResolveResultForFixes( 97 Future<FixesRequest> getFixesRequest(EditGetFixesParams parameters,
98 AnalysisDriverGeneric driver, String path) async { 98 covariant AnalysisDriverGeneric driver) async {
99 AnalysisError error = new AnalysisError( 99 AnalysisError error = new AnalysisError(
100 new MockSource(), 0, 0, CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT); 100 new MockSource(), 0, 0, CompileTimeErrorCode.AWAIT_IN_WRONG_CONTEXT);
101 return new AnalysisResult(null, null, null, null, null, null, 101 AnalysisResult result = new AnalysisResult(null, null, null, null, null,
102 new LineInfo([0, 20]), null, null, [error], null); 102 null, new LineInfo([0, 20]), null, null, [error], null);
103 return new FixesRequestImpl(resourceProvider, parameters.offset, result);
103 } 104 }
104 } 105 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698