| OLD | NEW |
| (Empty) | |
| 1 /* |
| 2 * Copyright (c) 2014, the Dart project authors. |
| 3 * |
| 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except |
| 5 * in compliance with the License. You may obtain a copy of the License at |
| 6 * |
| 7 * http://www.eclipse.org/legal/epl-v10.html |
| 8 * |
| 9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License |
| 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express |
| 11 * or implied. See the License for the specific language governing permissions a
nd limitations under |
| 12 * the License. |
| 13 * |
| 14 * This file has been automatically generated. Please do not edit it manually. |
| 15 * To regenerate the file, use the script "pkg/analysis_server/spec/generate_fil
es". |
| 16 */ |
| 17 package com.google.dart.server; |
| 18 |
| 19 import java.util.List; |
| 20 import java.util.Map; |
| 21 |
| 22 /** |
| 23 * The interface {@code AnalysisServer} defines the behavior of objects that int
erface to an |
| 24 * analysis server. |
| 25 * |
| 26 * @coverage dart.server |
| 27 */ |
| 28 public interface AnalysisServer2 { |
| 29 |
| 30 /** |
| 31 * Add the given listener to the list of listeners that will receive notificat
ion when new |
| 32 * analysis results become available. |
| 33 * |
| 34 * @param listener the listener to be added |
| 35 */ |
| 36 public void addAnalysisServerListener(AnalysisServerListener listener); |
| 37 /** |
| 38 * Start the analysis server. |
| 39 * |
| 40 * @param millisToRestart the number of milliseconds to wait for an unresponsi
ve server before |
| 41 * restarting it, or zero if the server should not be restarted. |
| 42 */ |
| 43 public void start(long millisToRestart) throws Exception; |
| 44 |
| 45 /** |
| 46 * {@code analysis.getErrors} |
| 47 * |
| 48 * Return the errors associated with the given file. If the errors for the giv
en file have not yet |
| 49 * been computed, or the most recently computed errors for the given file are
out of date, then the |
| 50 * response for this request will be delayed until they have been computed. If
some or all of the |
| 51 * errors for the file cannot be computed, then the subset of the errors that
can be computed will |
| 52 * be returned and the response will contain an error to indicate why the erro
rs could not be |
| 53 * computed. |
| 54 * |
| 55 * This request is intended to be used by clients that cannot asynchronously a
pply updated error |
| 56 * information. Clients that can apply error information as it becomes availab
le should use the |
| 57 * information provided by the 'analysis.errors' notification. |
| 58 * |
| 59 * @param file The file for which errors are being requested. |
| 60 */ |
| 61 // public void analysis_getErrors(String file, GetErrorsConsumer consumer); |
| 62 |
| 63 /** |
| 64 * {@code analysis.getHover} |
| 65 * |
| 66 * Return the hover information associate with the given location. If some or
all of the hover |
| 67 * information is not available at the time this request is processed the info
rmation will be |
| 68 * omitted from the response. |
| 69 * |
| 70 * @param file The file in which hover information is being requested. |
| 71 * @param offset The offset for which hover information is being requested. |
| 72 */ |
| 73 // public void analysis_getHover(String file, int offset, GetHoverConsumer con
sumer); |
| 74 |
| 75 /** |
| 76 * {@code analysis.reanalyze} |
| 77 * |
| 78 * Force the re-analysis of everything contained in the existing analysis root
s. This will cause |
| 79 * all previously computed analysis results to be discarded and recomputed, an
d will cause all |
| 80 * subscribed notifications to be re-sent. |
| 81 */ |
| 82 // public void analysis_reanalyze(); |
| 83 |
| 84 /** |
| 85 * {@code analysis.setAnalysisRoots} |
| 86 * |
| 87 * Sets the root paths used to determine which files to analyze. The set of fi
les to be analyzed |
| 88 * are all of the files in one of the root paths that are not also in one of t
he excluded paths. |
| 89 * |
| 90 * Note that this request determines the set of requested analysis roots. The
actual set of |
| 91 * analysis roots at any given time is the intersection of this set with the s
et of files and |
| 92 * directories actually present on the filesystem. When the filesystem changes
, the actual set of |
| 93 * analysis roots is automatically updated, but the set of requested analysis
roots is unchanged. |
| 94 * This means that if the client sets an analysis root before the root becomes
visible to server in |
| 95 * the filesystem, there is no error; once the server sees the root in the fil
esystem it will start |
| 96 * analyzing it. Similarly, server will stop analyzing files that are removed
from the file system |
| 97 * but they will remain in the set of requested roots. |
| 98 * |
| 99 * If an included path represents a file, then server will look in the directo
ry containing the |
| 100 * file for a pubspec.yaml file. If none is found, then the parents of the dir
ectory will be |
| 101 * searched until such a file is found or the root of the file system is reach
ed. If such a file is |
| 102 * found, it will be used to resolve package: URI’s within the file. |
| 103 * |
| 104 * @param included A list of the files and directories that should be analyzed
. |
| 105 * @param excluded A list of the files and directories within the included dir
ectories that should |
| 106 * not be analyzed. |
| 107 */ |
| 108 // public void analysis_setAnalysisRoots(List<String> included, List<String> e
xcluded); |
| 109 |
| 110 /** |
| 111 * {@code analysis.setPriorityFiles} |
| 112 * |
| 113 * Set the priority files to the files in the given list. A priority file is a
file that is given |
| 114 * priority when scheduling which analysis work to do first. The list typicall
y contains those |
| 115 * files that are visible to the user and those for which analysis results wil
l have the biggest |
| 116 * impact on the user experience. The order of the files within the list is si
gnificant: the first |
| 117 * file will be given higher priority than the second, the second higher prior
ity than the third, |
| 118 * and so on. |
| 119 * |
| 120 * Note that this request determines the set of requested priority files. The
actual set of |
| 121 * priority files is the intersection of the requested set of priority files w
ith the set of files |
| 122 * currently subject to analysis. (See analysis.setSubscriptions for a descrip
tion of files that |
| 123 * are subject to analysis.) |
| 124 * |
| 125 * If a requested priority file is a directory it is ignored, but remains in t
he set of requested |
| 126 * priority files so that if it later becomes a file it can be included in the
set of actual |
| 127 * priority files. |
| 128 * |
| 129 * @param files The files that are to be a priority for analysis. |
| 130 */ |
| 131 // public void analysis_setPriorityFiles(List<String> files); |
| 132 |
| 133 /** |
| 134 * {@code analysis.setSubscriptions} |
| 135 * |
| 136 * Subscribe for services. All previous subscriptions are replaced by the curr
ent set of |
| 137 * subscriptions. If a given service is not included as a key in the map then
no files will be |
| 138 * subscribed to the service, exactly as if the service had been included in t
he map with an |
| 139 * explicit empty list of files. |
| 140 * |
| 141 * Note that this request determines the set of requested subscriptions. The a
ctual set of |
| 142 * subscriptions at any given time is the intersection of this set with the se
t of files currently |
| 143 * subject to analysis. The files currently subject to analysis are the set of
files contained |
| 144 * within an actual analysis root but not excluded, plus all of the files tran
sitively reachable |
| 145 * from those files via import, export and part directives. (See analysis.setA
nalysisRoots for an |
| 146 * explanation of how the actual analysis roots are determined.) When the actu
al analysis roots |
| 147 * change, the actual set of subscriptions is automatically updated, but the s
et of requested |
| 148 * subscriptions is unchanged. |
| 149 * |
| 150 * If a requested subscription is a directory it is ignored, but remains in th
e set of requested |
| 151 * subscriptions so that if it later becomes a file it can be included in the
set of actual |
| 152 * subscriptions. |
| 153 * |
| 154 * It is an error if any of the keys in the map are not valid services. If the
re is an error, then |
| 155 * the existing subscriptions will remain unchanged. |
| 156 * |
| 157 * @param subscriptions A table mapping services to a list of the files being
subscribed to the |
| 158 * service. |
| 159 */ |
| 160 // public void analysis_setSubscriptions(Map<String, List<String>> subscriptio
ns); |
| 161 |
| 162 /** |
| 163 * {@code analysis.updateContent} |
| 164 * |
| 165 * Update the content of one or more files. Files that were previously updated
but not included in |
| 166 * this update remain unchanged. This effectively represents an overlay of the
filesystem. The |
| 167 * files whose content is overridden are therefore seen by server as being fil
es with the given |
| 168 * content, even if the files do not exist on the filesystem or if the file pa
th represents the |
| 169 * path to a directory on the filesystem. |
| 170 * |
| 171 * @param files A table mapping the files whose content has changed to a descr
iption of the content |
| 172 * change. Each value should be one of the following types: AddContentOverlay, |
| 173 * ChangeContentOverlay, or RemoveContentOverlay. |
| 174 */ |
| 175 // public void analysis_updateContent(Map<String, Object> files); |
| 176 |
| 177 /** |
| 178 * {@code analysis.updateOptions} |
| 179 * |
| 180 * Update the options controlling analysis based on the given set of options.
Any options that are |
| 181 * not included in the analysis options will not be changed. If there are opti
ons in the analysis |
| 182 * options that are not valid an error will be reported but the values of the
valid options will |
| 183 * still be updated. |
| 184 * |
| 185 * @param options The options that are to be used to control analysis. |
| 186 */ |
| 187 // public void analysis_updateOptions(AnalysisOptions options); |
| 188 |
| 189 /** |
| 190 * {@code completion.getSuggestions} |
| 191 * |
| 192 * Request that completion suggestions for the given offset in the given file
be returned. |
| 193 * |
| 194 * @param file The file containing the point at which suggestions are to be ma
de. |
| 195 * @param offset The offset within the file at which suggestions are to be mad
e. |
| 196 */ |
| 197 // public void completion_getSuggestions(String file, int offset, GetSuggestio
nsConsumer consumer); |
| 198 |
| 199 /** |
| 200 * {@code debug.createContext} |
| 201 * |
| 202 * Create a debugging context for the executable file with the given path. The
context that is |
| 203 * created will persist until debug.deleteContext is used to delete it. Client
s, therefore, are |
| 204 * responsible for managing the lifetime of debugging contexts. |
| 205 * |
| 206 * @param contextRoot The path of the Dart or HTML file that will be launched. |
| 207 */ |
| 208 // public void debug_createContext(String contextRoot, CreateContextConsumer c
onsumer); |
| 209 |
| 210 /** |
| 211 * {@code debug.deleteContext} |
| 212 * |
| 213 * Delete the debugging context with the given identifier. The context id is n
o longer valid after |
| 214 * this command. The server is allowed to re-use ids when they are no longer v
alid. |
| 215 * |
| 216 * @param id The identifier of the debugging context that is to be deleted. |
| 217 */ |
| 218 // public void debug_deleteContext(String id); |
| 219 |
| 220 /** |
| 221 * {@code debug.mapUri} |
| 222 * |
| 223 * Map a URI from the debugging context to the file that it corresponds to, or
map a file to the |
| 224 * URI that it corresponds to in the debugging context. |
| 225 * |
| 226 * Exactly one of the file and uri fields must be provided. |
| 227 * |
| 228 * @param id The identifier of the debugging context in which the URI is to be
mapped. |
| 229 * @param file The path of the file to be mapped into a URI. |
| 230 * @param uri The URI to be mapped into a file path. |
| 231 */ |
| 232 // public void debug_mapUri(String id, String file, String uri, MapUriConsumer
consumer); |
| 233 |
| 234 /** |
| 235 * {@code debug.setSubscriptions} |
| 236 * |
| 237 * Subscribe for services. All previous subscriptions are replaced by the give
n set of services. |
| 238 * |
| 239 * It is an error if any of the elements in the list are not valid services. I
f there is an error, |
| 240 * then the current subscriptions will remain unchanged. |
| 241 * |
| 242 * @param subscriptions A list of the services being subscribed to. |
| 243 */ |
| 244 // public void debug_setSubscriptions(List<String> subscriptions); |
| 245 |
| 246 /** |
| 247 * {@code edit.getAssists} |
| 248 * |
| 249 * Return the set of assists that are available at the given location. An assi
st is distinguished |
| 250 * from a refactoring primarily by the fact that it affects a single file and
does not require user |
| 251 * input in order to be performed. |
| 252 * |
| 253 * @param file The file containing the code for which assists are being reques
ted. |
| 254 * @param offset The offset of the code for which assists are being requested. |
| 255 * @param length The length of the code for which assists are being requested. |
| 256 */ |
| 257 // public void edit_getAssists(String file, int offset, int length, GetAssists
Consumer consumer); |
| 258 |
| 259 /** |
| 260 * {@code edit.getAvailableRefactorings} |
| 261 * |
| 262 * Get a list of the kinds of refactorings that are valid for the given select
ion in the given |
| 263 * file. |
| 264 * |
| 265 * @param file The file containing the code on which the refactoring would be
based. |
| 266 * @param offset The offset of the code on which the refactoring would be base
d. |
| 267 * @param length The length of the code on which the refactoring would be base
d. |
| 268 */ |
| 269 // public void edit_getAvailableRefactorings(String file, int offset, int leng
th, GetAvailableRefactoringsConsumer consumer); |
| 270 |
| 271 /** |
| 272 * {@code edit.getFixes} |
| 273 * |
| 274 * Return the set of fixes that are available for the errors at a given offset
in a given file. |
| 275 * |
| 276 * @param file The file containing the errors for which fixes are being reques
ted. |
| 277 * @param offset The offset used to select the errors for which fixes will be
returned. |
| 278 */ |
| 279 // public void edit_getFixes(String file, int offset, GetFixesConsumer consume
r); |
| 280 |
| 281 /** |
| 282 * {@code edit.getRefactoring} |
| 283 * |
| 284 * Get the changes required to perform a refactoring. |
| 285 * |
| 286 * @param kindId The identifier of the kind of refactoring to be performed. |
| 287 * @param file The file containing the code involved in the refactoring. |
| 288 * @param offset The offset of the region involved in the refactoring. |
| 289 * @param length The length of the region involved in the refactoring. |
| 290 * @param validateOnly True if the client is only requesting that the values o
f the options be |
| 291 * validated and no change be generated. |
| 292 * @param options Data used to provide values provided by the user. The struct
ure of the data is |
| 293 * dependent on the kind of refactoring being performed. The data that is expe
cted is documented in |
| 294 * the section titled Refactorings, labeled as “Options”. This field can be om
itted if the |
| 295 * refactoring does not require any options or if the values of those options
are not known. |
| 296 */ |
| 297 // public void edit_getRefactoring(String kindId, String file, int offset, int
length, boolean validateOnly, Object options, GetRefactoringConsumer consumer); |
| 298 |
| 299 /** |
| 300 * {@code search.findElementReferences} |
| 301 * |
| 302 * Perform a search for references to the element defined or referenced at the
given offset in the |
| 303 * given file. |
| 304 * |
| 305 * An identifier is returned immediately, and individual results will be retur
ned via the |
| 306 * search.results notification as they become available. |
| 307 * |
| 308 * @param file The file containing the declaration of or reference to the elem
ent used to define |
| 309 * the search. |
| 310 * @param offset The offset within the file of the declaration of or reference
to the element. |
| 311 * @param includePotential True if potential matches are to be included in the
results. |
| 312 */ |
| 313 // public void search_findElementReferences(String file, int offset, boolean i
ncludePotential, FindElementReferencesConsumer consumer); |
| 314 |
| 315 /** |
| 316 * {@code search.findMemberDeclarations} |
| 317 * |
| 318 * Perform a search for declarations of members whose name is equal to the giv
en name. |
| 319 * |
| 320 * An identifier is returned immediately, and individual results will be retur
ned via the |
| 321 * search.results notification as they become available. |
| 322 * |
| 323 * @param name The name of the declarations to be found. |
| 324 */ |
| 325 // public void search_findMemberDeclarations(String name, FindMemberDeclaratio
nsConsumer consumer); |
| 326 |
| 327 /** |
| 328 * {@code search.findMemberReferences} |
| 329 * |
| 330 * Perform a search for references to members whose name is equal to the given
name. This search |
| 331 * does not check to see that there is a member defined with the given name, s
o it is able to find |
| 332 * references to undefined members as well. |
| 333 * |
| 334 * An identifier is returned immediately, and individual results will be retur
ned via the |
| 335 * search.results notification as they become available. |
| 336 * |
| 337 * @param name The name of the references to be found. |
| 338 */ |
| 339 // public void search_findMemberReferences(String name, FindMemberReferencesCo
nsumer consumer); |
| 340 |
| 341 /** |
| 342 * {@code search.findTopLevelDeclarations} |
| 343 * |
| 344 * Perform a search for declarations of top-level elements (classes, typedefs,
getters, setters, |
| 345 * functions and fields) whose name matches the given pattern. |
| 346 * |
| 347 * An identifier is returned immediately, and individual results will be retur
ned via the |
| 348 * search.results notification as they become available. |
| 349 * |
| 350 * @param pattern The regular expression used to match the names of the declar
ations to be found. |
| 351 */ |
| 352 // public void search_findTopLevelDeclarations(String pattern, FindTopLevelDec
larationsConsumer consumer); |
| 353 |
| 354 /** |
| 355 * {@code search.getTypeHierarchy} |
| 356 * |
| 357 * Return the type hierarchy of the class declared or referenced at the given
location. |
| 358 * |
| 359 * @param file The file containing the declaration or reference to the type fo
r which a hierarchy |
| 360 * is being requested. |
| 361 * @param offset The offset of the name of the type within the file. |
| 362 */ |
| 363 // public void search_getTypeHierarchy(String file, int offset, GetTypeHierarc
hyConsumer consumer); |
| 364 |
| 365 /** |
| 366 * {@code server.getVersion} |
| 367 * |
| 368 * Return the version number of the analysis server. |
| 369 */ |
| 370 // public void server_getVersion(GetVersionConsumer consumer); |
| 371 |
| 372 /** |
| 373 * {@code server.setSubscriptions} |
| 374 * |
| 375 * Subscribe for services. All previous subscriptions are replaced by the give
n set of services. |
| 376 * |
| 377 * It is an error if any of the elements in the list are not valid services. I
f there is an error, |
| 378 * then the current subscriptions will remain unchanged. |
| 379 * |
| 380 * @param subscriptions A list of the services being subscribed to. |
| 381 */ |
| 382 // public void server_setSubscriptions(List<String> subscriptions); |
| 383 |
| 384 /** |
| 385 * {@code server.shutdown} |
| 386 * |
| 387 * Cleanly shutdown the analysis server. Requests that are received after this
request will not be |
| 388 * processed. Requests that were received before this request, but for which a
response has not yet |
| 389 * been sent, will not be responded to. No further responses or notifications
will be sent after |
| 390 * the response to this request has been sent. |
| 391 */ |
| 392 // public void server_shutdown(); |
| 393 } |
| OLD | NEW |