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

Side by Side Diff: editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/AnalysisServer.java

Issue 868183002: Move AnalysisServer to package ...generated to indicated that the file shouldnt be changed manually. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add file that wasn't added by git. Created 5 years, 11 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 | Annotate | Revision Log
OLDNEW
(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/tool/spec/generat e_files".
16 */
17 package com.google.dart.server;
18
19 import com.google.dart.server.generated.types.*;
20
21 import java.util.List;
22 import java.util.Map;
23
24 /**
25 * The interface {@code AnalysisServer} defines the behavior of objects that int erface to an
26 * analysis server.
27 *
28 * @coverage dart.server
29 */
30 public interface AnalysisServer {
31
32 /**
33 * Add the given listener to the list of listeners that will receive notificat ion when new
34 * analysis results become available.
35 *
36 * @param listener the listener to be added
37 */
38 public void addAnalysisServerListener(AnalysisServerListener listener);
39
40 /**
41 * Add the given listener to the list of listeners that will receive notificat ion when the server
42 * is not active
43 *
44 * @param listener the listener to be added
45 */
46 public void addStatusListener(AnalysisServerStatusListener listener);
47
48 /**
49 * {@code analysis.getErrors}
50 *
51 * Return the errors associated with the given file. If the errors for the giv en file have not yet
52 * been computed, or the most recently computed errors for the given file are out of date, then the
53 * response for this request will be delayed until they have been computed. If some or all of the
54 * errors for the file cannot be computed, then the subset of the errors that can be computed will
55 * be returned and the response will contain an error to indicate why the erro rs could not be
56 * computed. If the content of the file changes after this request was receive d but before a
57 * response could be sent, then an error of type CONTENT_MODIFIED will be gene rated.
58 *
59 * This request is intended to be used by clients that cannot asynchronously a pply updated error
60 * information. Clients that can apply error information as it becomes availab le should use the
61 * information provided by the 'analysis.errors' notification.
62 *
63 * If a request is made for a file which does not exist, or which is not curre ntly subject to
64 * analysis (e.g. because it is not associated with any analysis root specifie d to
65 * analysis.setAnalysisRoots), an error of type GET_ERRORS_INVALID_FILE will b e generated.
66 *
67 * @param file The file for which errors are being requested.
68 */
69 public void analysis_getErrors(String file, GetErrorsConsumer consumer);
70
71 /**
72 * {@code analysis.getHover}
73 *
74 * Return the hover information associate with the given location. If some or all of the hover
75 * information is not available at the time this request is processed the info rmation will be
76 * omitted from the response.
77 *
78 * @param file The file in which hover information is being requested.
79 * @param offset The offset for which hover information is being requested.
80 */
81 public void analysis_getHover(String file, int offset, GetHoverConsumer consum er);
82
83 /**
84 * {@code analysis.getLibraryDependencies}
85 *
86 * Return a list of all of the libraries referenced by any files in existing a nalysis roots.
87 */
88 public void analysis_getLibraryDependencies(GetLibraryDependenciesConsumer con sumer);
89
90 /**
91 * {@code analysis.getNavigation}
92 *
93 * Return the navigation information associated with the given region of the g iven file. If the
94 * navigation information for the given file has not yet been computed, or the most recently
95 * computed navigation information for the given file is out of date, then the response for this
96 * request will be delayed until it has been computed. If the content of the f ile changes after
97 * this request was received but before a response could be sent, then an erro r of type
98 * CONTENT_MODIFIED will be generated.
99 *
100 * If a navigation region overlaps (but extends either before or after) the gi ven region of the
101 * file it will be included in the result. This means that it is theoretically possible to get the
102 * same navigation region in response to multiple requests. Clients can avoid this by always
103 * choosing a region that starts at the beginning of a line and ends at the en d of a (possibly
104 * different) line in the file.
105 *
106 * @param file The file in which navigation information is being requested.
107 * @param offset The offset of the region for which navigation information is being requested.
108 * @param length The length of the region for which navigation information is being requested.
109 */
110 public void analysis_getNavigation(String file, int offset, int length, GetNav igationConsumer consumer);
111
112 /**
113 * {@code analysis.reanalyze}
114 *
115 * Force the re-analysis of everything contained in the existing analysis root s. This will cause
116 * all previously computed analysis results to be discarded and recomputed, an d will cause all
117 * subscribed notifications to be re-sent.
118 */
119 public void analysis_reanalyze();
120
121 /**
122 * {@code analysis.setAnalysisRoots}
123 *
124 * Sets the root paths used to determine which files to analyze. The set of fi les to be analyzed
125 * are all of the files in one of the root paths that are not also in one of t he excluded paths.
126 *
127 * Note that this request determines the set of requested analysis roots. The actual set of
128 * analysis roots at any given time is the intersection of this set with the s et of files and
129 * directories actually present on the filesystem. When the filesystem changes , the actual set of
130 * analysis roots is automatically updated, but the set of requested analysis roots is unchanged.
131 * This means that if the client sets an analysis root before the root becomes visible to server in
132 * the filesystem, there is no error; once the server sees the root in the fil esystem it will start
133 * analyzing it. Similarly, server will stop analyzing files that are removed from the file system
134 * but they will remain in the set of requested roots.
135 *
136 * If an included path represents a file, then server will look in the directo ry containing the
137 * file for a pubspec.yaml file. If none is found, then the parents of the dir ectory will be
138 * searched until such a file is found or the root of the file system is reach ed. If such a file is
139 * found, it will be used to resolve package: URI’s within the file.
140 *
141 * @param included A list of the files and directories that should be analyzed .
142 * @param excluded A list of the files and directories within the included dir ectories that should
143 * not be analyzed.
144 * @param packageRoots A mapping from source directories to target directories that should override
145 * the normal package: URI resolution mechanism. The analyzer will beh ave as though each
146 * source directory in the map contains a special pubspec.yaml file wh ich resolves any
147 * package: URI to the corresponding path within the target directory. The effect is the
148 * same as specifying the target directory as a "--package_root" param eter to the Dart VM
149 * when executing any Dart file inside the source directory. Files in any directories that
150 * are not overridden by this mapping have their package: URI's resolv ed using the normal
151 * pubspec.yaml mechanism. If this field is absent, or the empty map i s specified, that
152 * indicates that the normal pubspec.yaml mechanism should always be u sed.
153 */
154 public void analysis_setAnalysisRoots(List<String> included, List<String> excl uded, Map<String, String> packageRoots);
155
156 /**
157 * {@code analysis.setPriorityFiles}
158 *
159 * Set the priority files to the files in the given list. A priority file is a file that is given
160 * priority when scheduling which analysis work to do first. The list typicall y contains those
161 * files that are visible to the user and those for which analysis results wil l have the biggest
162 * impact on the user experience. The order of the files within the list is si gnificant: the first
163 * file will be given higher priority than the second, the second higher prior ity than the third,
164 * and so on.
165 *
166 * Note that this request determines the set of requested priority files. The actual set of
167 * priority files is the intersection of the requested set of priority files w ith the set of files
168 * currently subject to analysis. (See analysis.setSubscriptions for a descrip tion of files that
169 * are subject to analysis.)
170 *
171 * If a requested priority file is a directory it is ignored, but remains in t he set of requested
172 * priority files so that if it later becomes a file it can be included in the set of actual
173 * priority files.
174 *
175 * @param files The files that are to be a priority for analysis.
176 */
177 public void analysis_setPriorityFiles(List<String> files);
178
179 /**
180 * {@code analysis.setSubscriptions}
181 *
182 * Subscribe for services. All previous subscriptions are replaced by the curr ent set of
183 * subscriptions. If a given service is not included as a key in the map then no files will be
184 * subscribed to the service, exactly as if the service had been included in t he map with an
185 * explicit empty list of files.
186 *
187 * Note that this request determines the set of requested subscriptions. The a ctual set of
188 * subscriptions at any given time is the intersection of this set with the se t of files currently
189 * subject to analysis. The files currently subject to analysis are the set of files contained
190 * within an actual analysis root but not excluded, plus all of the files tran sitively reachable
191 * from those files via import, export and part directives. (See analysis.setA nalysisRoots for an
192 * explanation of how the actual analysis roots are determined.) When the actu al analysis roots
193 * change, the actual set of subscriptions is automatically updated, but the s et of requested
194 * subscriptions is unchanged.
195 *
196 * If a requested subscription is a directory it is ignored, but remains in th e set of requested
197 * subscriptions so that if it later becomes a file it can be included in the set of actual
198 * subscriptions.
199 *
200 * It is an error if any of the keys in the map are not valid services. If the re is an error, then
201 * the existing subscriptions will remain unchanged.
202 *
203 * @param subscriptions A table mapping services to a list of the files being subscribed to the
204 * service.
205 */
206 public void analysis_setSubscriptions(Map<String, List<String>> subscriptions) ;
207
208 /**
209 * {@code analysis.updateContent}
210 *
211 * Update the content of one or more files. Files that were previously updated but not included in
212 * this update remain unchanged. This effectively represents an overlay of the filesystem. The
213 * files whose content is overridden are therefore seen by server as being fil es with the given
214 * content, even if the files do not exist on the filesystem or if the file pa th represents the
215 * path to a directory on the filesystem.
216 *
217 * @param files A table mapping the files whose content has changed to a descr iption of the content
218 * change.
219 */
220 public void analysis_updateContent(Map<String, Object> files, UpdateContentCon sumer consumer);
221
222 /**
223 * {@code analysis.updateOptions}
224 *
225 * Update the options controlling analysis based on the given set of options. Any options that are
226 * not included in the analysis options will not be changed. If there are opti ons in the analysis
227 * options that are not valid, they will be silently ignored.
228 *
229 * @param options The options that are to be used to control analysis.
230 */
231 public void analysis_updateOptions(AnalysisOptions options);
232
233 /**
234 * {@code completion.getSuggestions}
235 *
236 * Request that completion suggestions for the given offset in the given file be returned.
237 *
238 * @param file The file containing the point at which suggestions are to be ma de.
239 * @param offset The offset within the file at which suggestions are to be mad e.
240 */
241 public void completion_getSuggestions(String file, int offset, GetSuggestionsC onsumer consumer);
242
243 /**
244 * {@code edit.format}
245 *
246 * Format the contents of a single file. The currently selected region of text is passed in so that
247 * the selection can be preserved across the formatting operation. The updated selection will be as
248 * close to matching the original as possible, but whitespace at the beginning or end of the
249 * selected region will be ignored.
250 *
251 * If a request is made for a file which does not exist, or which is not curre ntly subject to
252 * analysis (e.g. because it is not associated with any analysis root specifie d to
253 * analysis.setAnalysisRoots), an error of type FORMAT_INVALID_FILE will be ge nerated.
254 *
255 * @param file The file containing the code to be formatted.
256 * @param selectionOffset The offset of the current selection in the file.
257 * @param selectionLength The length of the current selection in the file.
258 */
259 public void edit_format(String file, int selectionOffset, int selectionLength, FormatConsumer consumer);
260
261 /**
262 * {@code edit.getAssists}
263 *
264 * Return the set of assists that are available at the given location. An assi st is distinguished
265 * from a refactoring primarily by the fact that it affects a single file and does not require user
266 * input in order to be performed.
267 *
268 * @param file The file containing the code for which assists are being reques ted.
269 * @param offset The offset of the code for which assists are being requested.
270 * @param length The length of the code for which assists are being requested.
271 */
272 public void edit_getAssists(String file, int offset, int length, GetAssistsCon sumer consumer);
273
274 /**
275 * {@code edit.getAvailableRefactorings}
276 *
277 * Get a list of the kinds of refactorings that are valid for the given select ion in the given
278 * file.
279 *
280 * @param file The file containing the code on which the refactoring would be based.
281 * @param offset The offset of the code on which the refactoring would be base d.
282 * @param length The length of the code on which the refactoring would be base d.
283 */
284 public void edit_getAvailableRefactorings(String file, int offset, int length, GetAvailableRefactoringsConsumer consumer);
285
286 /**
287 * {@code edit.getFixes}
288 *
289 * Return the set of fixes that are available for the errors at a given offset in a given file.
290 *
291 * @param file The file containing the errors for which fixes are being reques ted.
292 * @param offset The offset used to select the errors for which fixes will be returned.
293 */
294 public void edit_getFixes(String file, int offset, GetFixesConsumer consumer);
295
296 /**
297 * {@code edit.getRefactoring}
298 *
299 * Get the changes required to perform a refactoring.
300 *
301 * @param kind The kind of refactoring to be performed.
302 * @param file The file containing the code involved in the refactoring.
303 * @param offset The offset of the region involved in the refactoring.
304 * @param length The length of the region involved in the refactoring.
305 * @param validateOnly True if the client is only requesting that the values o f the options be
306 * validated and no change be generated.
307 * @param options Data used to provide values provided by the user. The struct ure of the data is
308 * dependent on the kind of refactoring being performed. The data that is expected is
309 * documented in the section titled Refactorings, labeled as “Options” . This field can be
310 * omitted if the refactoring does not require any options or if the v alues of those
311 * options are not known.
312 */
313 public void edit_getRefactoring(String kind, String file, int offset, int leng th, boolean validateOnly, RefactoringOptions options, GetRefactoringConsumer con sumer);
314
315 /**
316 * {@code edit.sortMembers}
317 *
318 * Sort all of the directives, unit and class members of the given Dart file.
319 *
320 * If a request is made for a file that does not exist, does not belong to an analysis root or is
321 * not a Dart file, SORT_MEMBERS_INVALID_FILE will be generated.
322 *
323 * If the Dart file has scan or parse errors, SORT_MEMBERS_PARSE_ERRORS will b e generated.
324 *
325 * @param file The Dart file to sort.
326 */
327 public void edit_sortMembers(String file, SortMembersConsumer consumer);
328
329 /**
330 * {@code execution.createContext}
331 *
332 * Create an execution context for the executable file with the given path. Th e context that is
333 * created will persist until execution.deleteContext is used to delete it. Cl ients, therefore, are
334 * responsible for managing the lifetime of execution contexts.
335 *
336 * @param contextRoot The path of the Dart or HTML file that will be launched.
337 */
338 public void execution_createContext(String contextRoot, CreateContextConsumer consumer);
339
340 /**
341 * {@code execution.deleteContext}
342 *
343 * Delete the execution context with the given identifier. The context id is n o longer valid after
344 * this command. The server is allowed to re-use ids when they are no longer v alid.
345 *
346 * @param id The identifier of the execution context that is to be deleted.
347 */
348 public void execution_deleteContext(String id);
349
350 /**
351 * {@code execution.mapUri}
352 *
353 * Map a URI from the execution context to the file that it corresponds to, or map a file to the
354 * URI that it corresponds to in the execution context.
355 *
356 * Exactly one of the file and uri fields must be provided.
357 *
358 * @param id The identifier of the execution context in which the URI is to be mapped.
359 * @param file The path of the file to be mapped into a URI.
360 * @param uri The URI to be mapped into a file path.
361 */
362 public void execution_mapUri(String id, String file, String uri, MapUriConsume r consumer);
363
364 /**
365 * {@code execution.setSubscriptions}
366 *
367 * Subscribe for services. All previous subscriptions are replaced by the give n set of services.
368 *
369 * It is an error if any of the elements in the list are not valid services. I f there is an error,
370 * then the current subscriptions will remain unchanged.
371 *
372 * @param subscriptions A list of the services being subscribed to.
373 */
374 public void execution_setSubscriptions(List<String> subscriptions);
375
376 /**
377 * Return {@code true} if the socket is open.
378 */
379 public boolean isSocketOpen();
380
381 /**
382 * Remove the given listener from the list of listeners that will receive noti fication when new
383 * analysis results become available.
384 *
385 * @param listener the listener to be removed
386 */
387 public void removeAnalysisServerListener(AnalysisServerListener listener);
388
389 /**
390 * {@code search.findElementReferences}
391 *
392 * Perform a search for references to the element defined or referenced at the given offset in the
393 * given file.
394 *
395 * An identifier is returned immediately, and individual results will be retur ned via the
396 * search.results notification as they become available.
397 *
398 * @param file The file containing the declaration of or reference to the elem ent used to define
399 * the search.
400 * @param offset The offset within the file of the declaration of or reference to the element.
401 * @param includePotential True if potential matches are to be included in the results.
402 */
403 public void search_findElementReferences(String file, int offset, boolean incl udePotential, FindElementReferencesConsumer consumer);
404
405 /**
406 * {@code search.findMemberDeclarations}
407 *
408 * Perform a search for declarations of members whose name is equal to the giv en name.
409 *
410 * An identifier is returned immediately, and individual results will be retur ned via the
411 * search.results notification as they become available.
412 *
413 * @param name The name of the declarations to be found.
414 */
415 public void search_findMemberDeclarations(String name, FindMemberDeclarationsC onsumer consumer);
416
417 /**
418 * {@code search.findMemberReferences}
419 *
420 * Perform a search for references to members whose name is equal to the given name. This search
421 * does not check to see that there is a member defined with the given name, s o it is able to find
422 * references to undefined members as well.
423 *
424 * An identifier is returned immediately, and individual results will be retur ned via the
425 * search.results notification as they become available.
426 *
427 * @param name The name of the references to be found.
428 */
429 public void search_findMemberReferences(String name, FindMemberReferencesConsu mer consumer);
430
431 /**
432 * {@code search.findTopLevelDeclarations}
433 *
434 * Perform a search for declarations of top-level elements (classes, typedefs, getters, setters,
435 * functions and fields) whose name matches the given pattern.
436 *
437 * An identifier is returned immediately, and individual results will be retur ned via the
438 * search.results notification as they become available.
439 *
440 * @param pattern The regular expression used to match the names of the declar ations to be found.
441 */
442 public void search_findTopLevelDeclarations(String pattern, FindTopLevelDeclar ationsConsumer consumer);
443
444 /**
445 * {@code search.getTypeHierarchy}
446 *
447 * Return the type hierarchy of the class declared or referenced at the given location.
448 *
449 * @param file The file containing the declaration or reference to the type fo r which a hierarchy
450 * is being requested.
451 * @param offset The offset of the name of the type within the file.
452 */
453 public void search_getTypeHierarchy(String file, int offset, GetTypeHierarchyC onsumer consumer);
454
455 /**
456 * {@code server.getVersion}
457 *
458 * Return the version number of the analysis server.
459 */
460 public void server_getVersion(GetVersionConsumer consumer);
461
462 /**
463 * {@code server.setSubscriptions}
464 *
465 * Subscribe for services. All previous subscriptions are replaced by the give n set of services.
466 *
467 * It is an error if any of the elements in the list are not valid services. I f there is an error,
468 * then the current subscriptions will remain unchanged.
469 *
470 * @param subscriptions A list of the services being subscribed to.
471 */
472 public void server_setSubscriptions(List<String> subscriptions);
473
474 /**
475 * {@code server.shutdown}
476 *
477 * Cleanly shutdown the analysis server. Requests that are received after this request will not be
478 * processed. Requests that were received before this request, but for which a response has not yet
479 * been sent, will not be responded to. No further responses or notifications will be sent after
480 * the response to this request has been sent.
481 */
482 public void server_shutdown();
483
484 /**
485 * Start the analysis server.
486 */
487 public void start() throws Exception;
488
489 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698