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 'dart:async'; | 5 import 'dart:async'; |
6 | 6 |
7 import 'package:analyzer/dart/analysis/results.dart'; | 7 import 'package:analyzer/dart/analysis/results.dart'; |
8 import 'package:analyzer/file_system/file_system.dart'; | 8 import 'package:analyzer/file_system/file_system.dart'; |
9 import 'package:analyzer_plugin/protocol/protocol.dart'; | 9 import 'package:analyzer_plugin/protocol/protocol.dart'; |
10 import 'package:analyzer_plugin/protocol/protocol_common.dart'; | 10 import 'package:analyzer_plugin/protocol/protocol_common.dart'; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
66 * An object used to produce completion suggestions. | 66 * An object used to produce completion suggestions. |
67 * | 67 * |
68 * Clients may implement this class when implementing plugins. | 68 * Clients may implement this class when implementing plugins. |
69 */ | 69 */ |
70 abstract class CompletionContributor { | 70 abstract class CompletionContributor { |
71 /** | 71 /** |
72 * Contribute completion suggestions for the completion location specified by | 72 * Contribute completion suggestions for the completion location specified by |
73 * the given [request] into the given [collector]. | 73 * the given [request] into the given [collector]. |
74 */ | 74 */ |
75 Future<Null> computeSuggestions( | 75 Future<Null> computeSuggestions( |
76 CompletionRequest request, CompletionCollector collector); | 76 covariant CompletionRequest request, CompletionCollector collector); |
77 } | 77 } |
78 | 78 |
79 /** | 79 /** |
80 * A generator that will generate a 'completion.getSuggestions' response. | 80 * A generator that will generate a 'completion.getSuggestions' response. |
81 * | 81 * |
82 * Clients may not extend, implement or mix-in this class. | 82 * Clients may not extend, implement or mix-in this class. |
83 */ | 83 */ |
84 class CompletionGenerator { | 84 class CompletionGenerator { |
85 /** | 85 /** |
86 * The contributors to be used to generate the completion suggestions. | 86 * The contributors to be used to generate the completion suggestions. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
122 collector.offset, collector.length, collector.suggestions); | 122 collector.offset, collector.length, collector.suggestions); |
123 return new GeneratorResult(result, notifications); | 123 return new GeneratorResult(result, notifications); |
124 } | 124 } |
125 } | 125 } |
126 | 126 |
127 /** | 127 /** |
128 * The information about a requested list of completions. | 128 * The information about a requested list of completions. |
129 * | 129 * |
130 * Clients may not extend, implement or mix-in this class. | 130 * Clients may not extend, implement or mix-in this class. |
131 */ | 131 */ |
132 abstract class CompletionRequest { | 132 abstract class CompletionRequest { |
maxkim
2017/06/22 20:52:56
Add String path.
| |
133 /** | 133 /** |
134 * Return the offset within the source at which the completion is being | 134 * Return the offset within the source at which the completion is being |
135 * requested. | 135 * requested. |
136 */ | 136 */ |
137 int get offset; | 137 int get offset; |
138 | 138 |
139 /** | 139 /** |
140 * Return the resource provider associated with this request. | 140 * Return the resource provider associated with this request. |
141 */ | 141 */ |
142 ResourceProvider get resourceProvider; | 142 ResourceProvider get resourceProvider; |
143 | 143 |
144 /** | 144 /** |
145 * The analysis result for the file in which the completion is being | |
146 * requested. | |
147 */ | |
148 ResolveResult get result; | |
149 | |
150 /** | |
151 * Throw an [AbortCompletion] if the completion request has been aborted. | 145 * Throw an [AbortCompletion] if the completion request has been aborted. |
152 */ | 146 */ |
153 void checkAborted(); | 147 void checkAborted(); |
154 } | 148 } |
149 | |
150 /** | |
151 * The information about a requested list of completions when completing in a | |
152 * `.dart` file. | |
153 * | |
154 * Clients may not extend, implement or mix-in this class. | |
155 */ | |
156 abstract class DartCompletionRequest implements CompletionRequest { | |
157 /** | |
158 * The analysis result for the file in which the completion is being | |
159 * requested. | |
160 */ | |
161 ResolveResult get result; | |
162 } | |
OLD | NEW |