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

Side by Side Diff: pkg/analyzer_plugin/lib/src/utilities/assist/assist.dart

Issue 2924063002: Add support for implementing getAssists in plugins (Closed)
Patch Set: Created 3 years, 6 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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'package:analyzer/dart/analysis/results.dart';
6 import 'package:analyzer/file_system/file_system.dart';
7 import 'package:analyzer_plugin/protocol/protocol_generated.dart';
8 import 'package:analyzer_plugin/utilities/assist/assist.dart';
9
10 /**
11 * A concrete implementation of [AssistCollector].
12 */
13 class AssistCollectorImpl implements AssistCollector {
14 /**
15 * The list of assists that have been collected.
16 */
17 final List<PrioritizedSourceChange> assists = <PrioritizedSourceChange>[];
18
19 @override
20 void addAssist(PrioritizedSourceChange assist) {
21 assists.add(assist);
22 }
23 }
24
25 /**
26 * A concrete implementation of [AssistRequest].
27 */
28 class AssistRequestImpl implements AssistRequest {
29 @override
30 final ResourceProvider resourceProvider;
31
32 @override
33 final int offset;
34
35 @override
36 final int length;
37
38 @override
39 final ResolveResult result;
40
41 /**
42 * Initialize a newly create request with the given data.
43 */
44 AssistRequestImpl(
45 this.resourceProvider, this.offset, this.length, this.result);
46 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698