OLD | NEW |
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 'package:analyzer/dart/analysis/results.dart'; | 5 import 'package:analyzer/dart/analysis/results.dart'; |
6 import 'package:analyzer/file_system/file_system.dart'; | 6 import 'package:analyzer/file_system/file_system.dart'; |
7 import 'package:analyzer_plugin/protocol/protocol.dart'; | 7 import 'package:analyzer_plugin/protocol/protocol.dart'; |
8 import 'package:analyzer_plugin/protocol/protocol_generated.dart'; | 8 import 'package:analyzer_plugin/protocol/protocol_generated.dart'; |
9 import 'package:analyzer_plugin/src/utilities/assist/assist.dart'; | 9 import 'package:analyzer_plugin/src/utilities/assist/assist.dart'; |
10 import 'package:analyzer_plugin/utilities/generator.dart'; | 10 import 'package:analyzer_plugin/utilities/generator.dart'; |
(...skipping 13 matching lines...) Expand all Loading... |
24 /** | 24 /** |
25 * An object used to produce assists. | 25 * An object used to produce assists. |
26 * | 26 * |
27 * Clients may implement this class when implementing plugins. | 27 * Clients may implement this class when implementing plugins. |
28 */ | 28 */ |
29 abstract class AssistContributor { | 29 abstract class AssistContributor { |
30 /** | 30 /** |
31 * Contribute assists for the location in the file specified by the given | 31 * Contribute assists for the location in the file specified by the given |
32 * [request] into the given [collector]. | 32 * [request] into the given [collector]. |
33 */ | 33 */ |
34 void computeAssists(AssistRequest request, AssistCollector collector); | 34 void computeAssists( |
| 35 covariant AssistRequest request, AssistCollector collector); |
35 } | 36 } |
36 | 37 |
37 /** | 38 /** |
38 * A generator that will generate an 'edit.getAssists' response. | 39 * A generator that will generate an 'edit.getAssists' response. |
39 * | 40 * |
40 * Clients may not extend, implement or mix-in this class. | 41 * Clients may not extend, implement or mix-in this class. |
41 */ | 42 */ |
42 class AssistGenerator { | 43 class AssistGenerator { |
43 /** | 44 /** |
44 * The contributors to be used to generate the assists. | 45 * The contributors to be used to generate the assists. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 /** | 89 /** |
89 * Return the offset of the selection within the source for which assists are | 90 * Return the offset of the selection within the source for which assists are |
90 * being requested. | 91 * being requested. |
91 */ | 92 */ |
92 int get offset; | 93 int get offset; |
93 | 94 |
94 /** | 95 /** |
95 * Return the resource provider associated with this request. | 96 * Return the resource provider associated with this request. |
96 */ | 97 */ |
97 ResourceProvider get resourceProvider; | 98 ResourceProvider get resourceProvider; |
| 99 } |
98 | 100 |
| 101 /** |
| 102 * The information about a requested set of assists when computing assists in a |
| 103 * `.dart` file. |
| 104 * |
| 105 * Clients may not extend, implement or mix-in this class. |
| 106 */ |
| 107 abstract class DartAssistRequest implements AssistRequest { |
99 /** | 108 /** |
100 * The analysis result for the file in which the assists are being requested. | 109 * The analysis result for the file in which the assists are being requested. |
101 */ | 110 */ |
102 ResolveResult get result; | 111 ResolveResult get result; |
103 } | 112 } |
OLD | NEW |