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

Side by Side Diff: pkg/analysis_server/spec/spec_input.html

Issue 443873006: Add analysis server API specification and related tools. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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 <html>
2 <head>
3 <meta charset="UTF-8"/>
4 <title>Analysis Server API Specification</title>
5 </head>
6 <body>
7 <h1>Analysis Server API Specification</h1>
8 <h1 style="color:#999999">WORKING DRAFT - Version <version>0.3</version></h1 >
9 <p>
10 This document contains a specification of the API provided by
11 the analysis server. The API in this document is currently under
12 development and should be expected to change. In some cases
13 those changes will be substantial.
14 </p>
15 <h2>Overview</h2>
16 <p>
17 The analysis server API is a bi-directional client-server
18 API. The API is independent of the transport mechanism used, but
19 is heavily influenced by a model in which sockets or character
20 streams are used to transport JSON-RPC encoded information.
21 </p>
22 <h3>Transport Mechanism</h3>
23 <p>
24 The characters passed to the server are expected to be encoded
25 using UTF-8.
26 </p>
27 <p>
28 When character streams are used as the transport, messages are
29 delineated by newlines. This means, in particular, that the JSON
30 encoding process must not introduce newlines within a
31 message. Note however that newlines are used in this document
32 for readability.
33 </p>
34 <p>
35 To ease interoperability with Lisp-based clients (which may not
36 be able to easily distinguish between empty lists, empty maps,
37 and null), client-to-server communication is allowed to replace
38 any instance of “<tt>{}</tt>” or “<tt>[]</tt>” with null. The
39 server will always properly represent empty lists as
40 “<tt>[]</tt>” and empty maps as “<tt>{}</tt>”.
41 </p>
42 <h3>Communication Structure</h3>
43 <p>
44 Clients can make a request of the server and the server will
45 provide a response for each request that it receives. While many
46 of the requests that can be made by a client are informational
47 in nature, we have chosen to always return a response so that
48 clients can know whether the request was received and was
49 correct.
50 </p>
51 <p>
52 There is no guarantee concerning the order in which responses
53 will be returned, but there is a guarantee that the server will
54 process requests in the order in which they are sent as long as
55 the transport mechanism also makes this guarantee. Responses can
56 be returned in an order that is different from the order in
57 which the requests were received because some requests take
58 longer to process than others.
59 </p>
60 <p>
61 Every request is required to have two fields and may have an
62 optional third field. The first required field is the ‘id’
63 field, which is only used by the server to associate a response
64 with the request that generated the response. The second
65 required field is the ‘method’ field, which is used to determine
66 what the server is being requested to do. The optional field is
67 the ‘params’ field, whose structure is dependent on the method
68 being requested. The structure of this field is described with
69 each request for which it is required.
70 </p>
71 <p>
72 Every response has up to three fields. The first field is the
73 ‘id’ field, which is always present and whose value is the
74 identifier that was passed to the request that generated the
75 response. The second field is the ‘error’ field, which is only
76 present if an error was encountered while processing the
77 request. The third field is the ‘result’ field, whose structure
78 is dependent on the method being responded to, and is described
79 with each request that will produce it.
80 </p>
81 <p>
82 The server can also communicate to the clients by sending a
83 notification. The purpose of these notifications is to provide
84 information to clients as it becomes available rather than to
85 require that clients poll for it. Unless explicitly stated, all
86 notifications are designed to return the complete information
87 available at the time the notification is sent; clients are not
88 required to update previously communicated
89 results. Consequently, the server can and should return partial
90 results before all results are available. For example, the
91 syntactic errors for a file can be returned as soon as the
92 syntactic analysis is complete, and both syntactic and semantic
93 errors can be returned together at a later time.
94 </p>
95 <p>
96 Each notification has two fields. The first field is the ‘event’
97 field, which identifies the kind of notification. The second
98 field is the ‘params’ field, whose structure is dependent on the
99 kind of notification being sent. The structure of this field is
100 described with each notification.
101 </p>
102 <h3>Eventual Consistency</h3>
103 <p>
104 TBD
105 </p>
106 <h3>Domains</h3>
107 <p>
108 For convenience, the API is divided into domains. Each domain is
109 specified in a separate section below:
110 </p>
111 <ul>
112 <li><a href="#domain_server">Server</a></li>
113 <li><a href="#domain_analysis">Analysis</a></li>
114 <li><a href="#domain_completion">Code Completion</a></li>
115 <li><a href="#domain_search">Search</a></li>
116 <li><a href="#domain_edit">Edit</a></li>
117 <li><a href="#domain_debug">Debugging</a></li>
118 </ul>
119 <p>
120 The specifications of the API’s refer to data structures beyond
121 the standard JSON primitives. These data structures are
122 documented in the section titled <a href="#types">Types</a>.
123 </p>
124 <h3>Command-line Arguments</h3>
125 <p>
126 The command-line arguments that can be passed to the server.
127 </p>
128 <h4>Options</h4>
129 <dl>
130 <dt>--no-error-notification</dt>
131 <dd></dd>
132 </dl>
133 <p>
134 Disable notifications about errors (see analysis.error). If this
135 flag is not specified then notifications will be sent for all
136 errors produced for all files in the actual analysis roots.
137 </p>
138 <domain name="server">
139 <p>
140 The server domain contains API’s related to the execution of
141 the server.
142 </p>
143 <request method="getVersion">
144 <p>Return the version number of the analysis server.</p>
145 <result>
146 <field name="version">
147 <ref>String</ref>
148 <p>The version number of the analysis server.</p>
149 </field>
150 </result>
151 </request>
152 <request method="shutdown">
153 <p>
154 Cleanly shutdown the analysis server. Requests that are
155 received after this request will not be processed. Requests
156 that were received before this request, but for which a
157 response has not yet been sent, will not be responded to. No
158 further responses or notifications will be sent after the
159 response to this request has been sent.
160 </p>
161 </request>
162 <request method="setSubscriptions">
163 <p>
164 Subscribe for services. All previous subscriptions are
165 replaced by the given set of services.
166 </p>
167 <p>
168 It is an error if any of the elements in the list are not
169 valid services. If there is an error, then the current
170 subscriptions will remain unchanged.
171 </p>
172 <params>
173 <field name="subscriptions">
174 <list><ref>ServerService</ref></list>
175 <p>A list of the services being subscribed to.</p>
176 </field>
177 </params>
178 </request>
179 <notification event="connected">
180 <p>
181 Reports that the server is running. This notification is
182 issued once after the server has started running but before
183 any requests are processed to let the client know that it
184 started correctly.
185 </p>
186 <p>
187 It is not possible to subscribe to or unsubscribe from this
188 notification.
189 </p>
190 </notification>
191 <notification event="error">
192 <p>
193 Reports that an unexpected error has occurred while
194 executing the server. This notification is not used for
195 problems with specific requests (which are returned as part
196 of the response) but is used for exceptions that occur while
197 performing other tasks, such as analysis or preparing
198 notifications.
199 </p>
200 <p>
201 It is not possible to subscribe to or unsubscribe from this
202 notification.
203 </p>
204 <params>
205 <field name="fatal">
206 <ref>bool</ref>
207 <p>
208 True if the error is a fatal error, meaning that the
209 server will shutdown automatically after sending this
210 notification.
211 </p>
212 </field>
213 <field name="message">
214 <ref>String</ref>
215 <p>
216 The error message indicating what kind of error was
217 encountered.
218 </p>
219 </field>
220 <field name="stackTrace">
221 <ref>String</ref>
222 <p>
223 The stack trace associated with the generation of the
224 error, used for debugging the server.
225 </p>
226 </field>
227 </params>
228 </notification>
229 <notification event="status">
230 <p>
231 Reports the current status of the server. Parameters are
232 omitted if there has been no change in the status
233 represented by that parameter.
234 </p>
235 <p>
236 This notification is not subscribed to by default. Clients
237 can subscribe by including the value <tt>"STATUS"</tt> in
238 the list of services passed in a server.setSubscriptions
239 request.
240 </p>
241 <params>
242 <field name="analysis" optional="true">
243 <ref>AnalysisStatus</ref>
244 <p>
245 The current status of analysis, including whether
246 analysis is being performed and if so what is being
247 analyzed.
248 </p>
249 </field>
250 </params>
251 </notification>
252 </domain>
253 <domain name="analysis">
254 <p>
255 The analysis domain contains API’s related to the analysis of
256 files.
257 </p>
258 <request method="getErrors">
259 <p>
260 Return the errors associated with the given file. If the
261 errors for the given file have not yet been computed, or the
262 most recently computed errors for the given file are out of
263 date, then the response for this request will be delayed
264 until they have been computed. If some or all of the errors
265 for the file cannot be computed, then the subset of the
266 errors that can be computed will be returned and the
267 response will contain an error to indicate why the errors
268 could not be computed.
269 </p>
270 <p>
271 This request is intended to be used by clients that cannot
272 asynchronously apply updated error information. Clients that
273 <b>can</b> apply error information as it becomes available
274 should use the information provided by the 'analysis.errors'
275 notification.
276 </p>
277 <params>
278 <field name="file">
279 <ref>FilePath</ref>
280 <p>
281 The file for which errors are being requested.
282 </p>
283 </field>
284 </params>
285 <result>
286 <field name="errors">
287 <list><ref>AnalysisError</ref></list>
288 <p>
289 The errors associated with the file.
290 </p>
291 </field>
292 </result>
293 </request>
294 <request method="getHover">
295 <p>
296 Return the hover information associate with the given
297 location. If some or all of the hover information is not
298 available at the time this request is processed the
299 information will be omitted from the response.
300 </p>
301 <params>
302 <field name="file">
303 <ref>FilePath</ref>
304 <p>
305 The file in which hover information is being
306 requested.
307 </p>
308 </field>
309 <field name="offset">
310 <ref>int</ref>
311 <p>
312 The offset for which hover information is being
313 requested.
314 </p>
315 </field>
316 </params>
317 <result>
318 <field name="hovers">
319 <list><ref>HoverInformation</ref></list>
320 <p>
321 The hover information associated with the
322 location. The list will be empty if no information
323 could be determined for the location. The list can
324 contain multiple items if the file is being analyzed
325 in multiple contexts in conflicting ways (such as a
326 part that is included in multiple libraries).
327 </p>
328 </field>
329 </result>
330 </request>
331 <request method="reanalyze">
332 <p>
333 Force the re-analysis of everything contained in the
334 existing analysis roots. This will cause all previously
335 computed analysis results to be discarded and recomputed,
336 and will cause all subscribed notifications to be re-sent.
337 </p>
338 </request>
339 <request method="setAnalysisRoots">
340 <p>
341 Sets the root paths used to determine which files to
342 analyze. The set of files to be analyzed are all of the
343 files in one of the root paths that are not also in one of
344 the excluded paths.
345 </p>
346 <p>
347 Note that this request determines the set of requested
348 analysis roots. The actual set of analysis roots at any
349 given time is the intersection of this set with the set of
350 files and directories actually present on the
351 filesystem. When the filesystem changes, the actual set of
352 analysis roots is automatically updated, but the set of
353 requested analysis roots is unchanged. This means that if
354 the client sets an analysis root before the root becomes
355 visible to server in the filesystem, there is no error; once
356 the server sees the root in the filesystem it will start
357 analyzing it. Similarly, server will stop analyzing files
358 that are removed from the file system but they will remain
359 in the set of requested roots.
360 </p>
361 <p>
362 If an included path represents a file, then server will look
363 in the directory containing the file for a pubspec.yaml
364 file. If none is found, then the parents of the directory
365 will be searched until such a file is found or the root of
366 the file system is reached. If such a file is found, it will
367 be used to resolve package: URI’s within the file.
368 </p>
369 <params>
370 <field name="included">
371 <list><ref>FilePath</ref></list>
372 <p>
373 A list of the files and directories that should be
374 analyzed.
375 </p>
376 </field>
377 <field name="excluded">
378 <list><ref>FilePath</ref></list>
379 <p>
380 A list of the files and directories within the
381 included directories that should not be analyzed.
382 </p>
383 </field>
384 </params>
385 </request>
386 <request method="setPriorityFiles">
387 <p>
388 Set the priority files to the files in the given list. A
389 priority file is a file that is given priority when
390 scheduling which analysis work to do first. The list
391 typically contains those files that are visible to the user
392 and those for which analysis results will have the biggest
393 impact on the user experience. The order of the files within
394 the list is significant: the first file will be given higher
395 priority than the second, the second higher priority than
396 the third, and so on.
397 </p>
398 <p>
399 Note that this request determines the set of requested
400 priority files. The actual set of priority files is the
401 intersection of the requested set of priority files with the
402 set of files currently subject to analysis. (See
403 analysis.setSubscriptions for a description of files that
404 are subject to analysis.)
405 </p>
406 <p>
407 If a requested priority file is a directory it is ignored,
408 but remains in the set of requested priority files so that
409 if it later becomes a file it can be included in the set of
410 actual priority files.
411 </p>
412 <params>
413 <field name="files">
414 <list><ref>FilePath</ref></list>
415 <p>
416 The files that are to be a priority for analysis.
417 </p>
418 </field>
419 </params>
420 </request>
421 <request method="setSubscriptions">
422 <p>
423 Subscribe for services. All previous subscriptions are
424 replaced by the current set of subscriptions. If a given
425 service is not included as a key in the map then no files
426 will be subscribed to the service, exactly as if the service
427 had been included in the map with an explicit empty list of
428 files.
429 </p>
430 <p>
431 Note that this request determines the set of requested
432 subscriptions. The actual set of subscriptions at any given
433 time is the intersection of this set with the set of files
434 currently subject to analysis. The files currently subject
435 to analysis are the set of files contained within an actual
436 analysis root but not excluded, plus all of the files
437 transitively reachable from those files via import, export
438 and part directives. (See analysis.setAnalysisRoots for an
439 explanation of how the actual analysis roots are
440 determined.) When the actual analysis roots change, the
441 actual set of subscriptions is automatically updated, but
442 the set of requested subscriptions is unchanged.
443 </p>
444 <p>
445 If a requested subscription is a directory it is ignored,
446 but remains in the set of requested subscriptions so that if
447 it later becomes a file it can be included in the set of
448 actual subscriptions.
449 </p>
450 <p>
451 It is an error if any of the keys in the map are not valid
452 services. If there is an error, then the existing
453 subscriptions will remain unchanged.
454 </p>
455 <params>
456 <field name="subscriptions">
457 <map>
458 <key><ref>AnalysisService</ref></key>
459 <value>
460 <list><ref>FilePath</ref></list>
461 </value>
462 </map>
463 <p>
464 A table mapping services to a list of the files being
465 subscribed to the service.
466 </p>
467 </field>
468 </params>
469 </request>
470 <request method="updateContent">
471 <p>
472 Update the content of one or more files. Files that were
473 previously updated but not included in this update remain
474 unchanged. This effectively represents an overlay of the
475 filesystem. The files whose content is overridden are
476 therefore seen by server as being files with the given
477 content, even if the files do not exist on the filesystem or
478 if the file path represents the path to a directory on the
479 filesystem.
480 </p>
481 <params>
482 <field name="files">
483 <map>
484 <key><ref>FilePath</ref></key>
485 <value><ref>ContentChange</ref></value>
486 </map>
487 <p>
488 A table mapping the files whose content has changed to
489 a description of the content.
490 </p>
491 </field>
492 </params>
493 </request>
494 <request method="updateOptions">
495 <p>
496 Update the options controlling analysis based on the given
497 set of options. Any options that are not included in the
498 analysis options will not be changed. If there are options
499 in the analysis options that are not valid an error will be
500 reported but the values of the valid options will still be
501 updated.
502 </p>
503 <params>
504 <field name="options">
505 <ref>AnalysisOptions</ref>
506 <p>
507 The options that are to be used to control analysis.
508 </p>
509 </field>
510 </params>
511 </request>
512 <notification event="errors">
513 <p>
514 Reports the errors associated with a given file. The set of
515 errors included in the notification is always a complete
516 list that supersedes any previously reported errors.
517 </p>
518 <p>
519 It is only possible to unsubscribe from this notification by
520 using the command-line flag --no-error-notification.
521 </p>
522 <params>
523 <field name="file">
524 <ref>FilePath</ref>
525 <p>
526 The file containing the errors.
527 </p>
528 </field>
529 <field name="errors">
530 <list><ref>AnalysisError</ref></list>
531 <p>
532 The errors contained in the file.
533 </p>
534 </field>
535 </params>
536 </notification>
537 <notification event="flushResults">
538 <p>
539 Reports that any analysis results that were previously
540 associated with the given files should be considered to be
541 invalid because those files are no longer being analyzed,
542 either because the analysis root that contained it is no
543 longer being analyzed or because the file no longer exists.
544 </p>
545 <p>
546 If a file is included in this notification and at some later
547 time a notification with results for the file is received,
548 clients should assume that the file is once again being
549 analyzed and the information should be processed.
550 </p>
551 <p>
552 It is not possible to subscribe to or unsubscribe from this
553 notification.
554 </p>
555 <params>
556 <field name="files">
557 <list><ref>FilePath</ref></list>
558 <p>
559 The files that are no longer being analyzed.
560 </p>
561 </field>
562 </params>
563 </notification>
564 <notification event="folding">
565 <p>
566 Reports the folding regions associated with a given
567 file. Folding regions can be nested, but will not be
568 overlapping. Nesting occurs when a foldable element, such as
569 a method, is nested inside another foldable element such as
570 a class.
571 </p>
572 <p>
573 This notification is not subscribed to by default. Clients
574 can subscribe by including the value <tt>"FOLDING"</tt> in
575 the list of services passed in an analysis.setSubscriptions
576 request.
577 </p>
578 <params>
579 <field name="file">
580 <ref>FilePath</ref>
581 <p>
582 The file containing the folding regions.
583 </p>
584 </field>
585 <field name="regions">
586 <list><ref>FoldingRegion</ref></list>
587 <p>
588 The folding regions contained in the file.
589 </p>
590 </field>
591 </params>
592 </notification>
593 <notification event="highlights">
594 <p>
595 Reports the highlight regions associated with a given file.
596 </p>
597 <p>
598 This notification is not subscribed to by default. Clients
599 can subscribe by including the value <tt>"HIGHLIGHTS"</tt>
600 in the list of services passed in an
601 analysis.setSubscriptions request.
602 </p>
603 <params>
604 <field name="file">
605 <ref>FilePath</ref>
606 <p>
607 The file containing the highlight regions.
608 </p>
609 </field>
610 <field name="regions">
611 <list><ref>HighlightRegion</ref></list>
612 <p>
613 The highlight regions contained in the file. Each
614 highlight region represents a particular syntactic or
615 semantic meaning associated with some range. Note that
616 the highlight regions that are returned can overlap
617 other highlight regions if there is more than one
618 meaning associated with a particular region.
619 </p>
620 </field>
621 </params>
622 </notification>
623 <notification event="navigation">
624 <p>
625 Reports the navigation targets associated with a given file.
626 </p>
627 <p>
628 This notification is not subscribed to by default. Clients
629 can subscribe by including the value <tt>"NAVIGATION"</tt>
630 in the list of services passed in an
631 analysis.setSubscriptions request.
632 </p>
633 <params>
634 <field name="file">
635 <ref>FilePath</ref>
636 <p>
637 The file containing the navigation regions.
638 </p>
639 </field>
640 <field name="regions">
641 <list><ref>NavigationRegion</ref></list>
642 <p>
643 The navigation regions contained in the file. Each
644 navigation region represents a list of targets
645 associated with some range. The lists will usually
646 contain a single target, but can contain more in the
647 case of a part that is included in multiple libraries
648 or in Dart code that is compiled against multiple
649 versions of a package. Note that the navigation
650 regions that are returned do not overlap other
651 navigation regions.
652 </p>
653 </field>
654 </params>
655 </notification>
656 <notification event="occurrences">
657 <p>
658 Reports the occurrences of references to elements within a
659 single file.
660 </p>
661 <p>
662 This notification is not subscribed to by default. Clients
663 can subscribe by including the value <tt>"OCCURRENCES"</tt>
664 in the list of services passed in an
665 analysis.setSubscriptions request.
666 </p>
667 <params>
668 <field name="file">
669 <ref>FilePath</ref>
670 <p>
671 The file in which the references occur.
672 </p>
673 </field>
674 <field name="occurrences">
675 <list><ref>Occurrences</ref></list>
676 <p>
677 The occurrences of references to elements within the
678 file.
679 </p>
680 </field>
681 </params>
682 </notification>
683 <notification event="outline">
684 <p>
685 Reports the outline associated with a single file.
686 </p>
687 <p>
688 This notification is not subscribed to by default. Clients
689 can subscribe by including the value <tt>"OUTLINE"</tt> in
690 the list of services passed in an analysis.setSubscriptions
691 request.
692 </p>
693 <params>
694 <field name="file">
695 <ref>FilePath</ref>
696 <p>
697 The file with which the outline is associated.
698 </p>
699 </field>
700 <field name="outline">
701 <ref>Outline</ref>
702 <p>
703 The outline associated with the file.
704 </p>
705 </field>
706 </params>
707 </notification>
708 <notification event="overrides">
709 <p>
710 Reports the overridding members in a file. This notification
711 currently includes only members that override a member from
712 a superclass. In particular, it does not include members
713 that override members from interfaces.
714 </p>
715 <p>
716 This notification is not subscribed to by default. Clients
717 can subscribe by including the value <tt>"OVERRIDES"</tt> in
718 the list of services passed in an analysis.setSubscriptions
719 request.
720 </p>
721 <params>
722 <field name="file">
723 <ref>FilePath</ref>
724 <p>
725 The file with which the overrides are associated.
726 </p>
727 </field>
728 <field name="overrides">
729 <list><ref>Override</ref></list>
730 <p>
731 The overrides associated with the file.
732 </p>
733 </field>
734 </params>
735 </notification>
736 </domain>
737 <domain name="completion">
738 <p>
739 The code completion domain contains commands related to
740 getting code completion suggestions.
741 </p>
742 <request method="getSuggestions">
743 <p>
744 Request that completion suggestions for the given offset in
745 the given file be returned.
746 </p>
747 <params>
748 <field name="file">
749 <ref>FilePath</ref>
750 <p>
751 The file containing the point at which suggestions are
752 to be made.
753 </p>
754 </field>
755 <field name="offset">
756 <ref>int</ref>
757 <p>
758 The offset within the file at which suggestions are to
759 be made.
760 </p>
761 </field>
762 </params>
763 <result>
764 <field name="id">
765 <ref>CompletionId</ref>
766 <p>
767 The identifier used to associate results with this
768 completion request.
769 </p>
770 </field>
771 </result>
772 </request>
773 <notification event="results">
774 <p>
775 Reports the completion suggestions that should be presented
776 to the user. The set of suggestions included in the
777 notification is always a complete list that supersedes any
778 previously reported suggestions.
779 </p>
780 <params>
781 <field name="id">
782 <ref>CompletionId</ref>
783 <p>
784 The id associated with the completion.
785 </p>
786 </field>
787 <field name="replacementOffset">
788 <ref>int</ref>
789 <p>
790 The offset of the start of the text to be
791 replaced. This will be different than the offset used
792 to request the completion suggestions if there was a
793 portion of an identifier before the original
794 offset. In particular, the replacementOffset will be
795 the offset of the beginning of said identifier.
796 </p>
797 </field>
798 <field name="replacementLength">
799 <ref>int</ref>
800 <p>
801 The length of the text to be replaced if the remainder
802 of the identifier containing the cursor is to be
803 replaced when the suggestion is applied (that is, the
804 number of characters in the existing identifier).
805 </p>
806 </field>
807 <field name="results">
808 <list><ref>CompletionSuggestion</ref></list>
809 <p>
810 The completion suggestions being reported.
811 </p>
812 </field>
813 <field name="last">
814 <ref>bool</ref>
815 <p>
816 True if this is that last set of results that will be
817 returned for the indicated completion.
818 </p>
819 </field>
820 </params>
821 </notification>
822 </domain>
823 <domain name="search">
824 <p>
825 The search domain contains commands related to searches that
826 can be performed against the code base.
827 </p>
828 <request method="findElementReferences">
829 <p>
830 Perform a search for references to the element defined or
831 referenced at the given offset in the given file.
832 </p>
833 <p>
834 An identifier is returned immediately, and individual
835 results will be returned via the search.results notification
836 as they become available.
837 </p>
838 <params>
839 <field name="file">
840 <ref>FilePath</ref>
841 <p>
842 The file containing the declaration of or reference to
843 the element used to define the search.
844 </p>
845 </field>
846 <field name="offset">
847 <ref>int</ref>
848 <p>
849 The offset within the file of the declaration of or
850 reference to the element.
851 </p>
852 </field>
853 <field name="includePotential">
854 <ref>bool</ref>
855 <p>
856 True if potential matches are to be included in the
857 results.
858 </p>
859 </field>
860 </params>
861 <result>
862 <field name="id">
863 <ref>SearchId</ref>
864 <p>
865 The identifier used to associate results with this
866 search request.
867 </p>
868 </field>
869 <field name="element">
870 <ref>Element</ref>
871 <p>
872 The element referenced or defined at the given offset
873 and whose references will be returned in the search
874 results.
875 </p>
876 </field>
877 </result>
878 </request>
879 <request method="findMemberDeclarations">
880 <p>
881 Perform a search for declarations of members whose name is
882 equal to the given name.
883 </p>
884 <p>
885 An identifier is returned immediately, and individual
886 results will be returned via the search.results notification
887 as they become available.
888 </p>
889 <params>
890 <field name="name">
891 <ref>String</ref>
892 <p>
893 The name of the declarations to be found.
894 </p>
895 </field>
896 </params>
897 <result>
898 <field name="id">
899 <ref>SearchId</ref>
900 <p>
901 The identifier used to associate results with this
902 search request.
903 </p>
904 </field>
905 </result>
906 </request>
907 <request method="findMemberReferences">
908 <p>
909 Perform a search for references to members whose name is
910 equal to the given name. This search does not check to see
911 that there is a member defined with the given name, so it is
912 able to find references to undefined members as well.
913 </p>
914 <p>
915 An identifier is returned immediately, and individual
916 results will be returned via the search.results notification
917 as they become available.
918 </p>
919 <params>
920 <field name="name">
921 <ref>String</ref>
922 <p>
923 The name of the references to be found.
924 </p>
925 </field>
926 </params>
927 <result>
928 <field name="id">
929 <ref>SearchId</ref>
930 <p>
931 The identifier used to associate results with this
932 search request.
933 </p>
934 </field>
935 </result>
936 </request>
937 <request method="findTopLevelDeclarations">
938 <p>
939 Perform a search for declarations of top-level elements
940 (classes, typedefs, getters, setters, functions and fields)
941 whose name matches the given pattern.
942 </p>
943 <p>
944 An identifier is returned immediately, and individual
945 results will be returned via the search.results notification
946 as they become available.
947 </p>
948 <params>
949 <field name="pattern">
950 <ref>String</ref>
951 <p>
952 The regular expression used to match the names of the
953 declarations to be found.
954 </p>
955 </field>
956 </params>
957 <result>
958 <field name="id">
959 <ref>SearchId</ref>
960 <p>
961 The identifier used to associate results with this
962 search request.
963 </p>
964 </field>
965 </result>
966 </request>
967 <request method="getTypeHierarchy">
968 <p>
969 Return the type hierarchy of the class declared or
970 referenced at the given location.
971 </p>
972 <params>
973 <field name="file">
974 <ref>FilePath</ref>
975 <p>
976 The file containing the declaration or reference to the
977 type for which a hierarchy is being requested.
978 </p>
979 </field>
980 <field name="offset">
981 <ref>int</ref>
982 <p>
983 The offset of the name of the type within the file.
984 </p>
985 </field>
986 </params>
987 <result>
988 <field name="hierarchyItems">
989 <list><ref>TypeHierarchyItem</ref></list>
990 <p>
991 A list of the types in the requested hierarchy. The
992 first element of the list is the item representing the
993 type for which the hierarchy was requested. The index of
994 other elements of the list is unspecified, but
995 correspond to the integers used to reference supertype
996 and subtype items within the items.
997 </p>
998 </field>
999 </result>
1000 </request>
1001 <notification event="results">
1002 <p>
1003 Reports some or all of the results of performing a requested
1004 search. Unlike other notifications, this notification
1005 contains search results that should be added to any
1006 previously received search results associated with the same
1007 search id.
1008 </p>
1009 <params>
1010 <field name="id">
1011 <ref>SearchId</ref>
1012 <p>
1013 The id associated with the search.
1014 </p>
1015 </field>
1016 <field name="results">
1017 <list><ref>SearchResult</ref></list>
1018 <p>
1019 The search results being reported.
1020 </p>
1021 </field>
1022 <field name="last">
1023 <ref>bool</ref>
1024 <p>
1025 True if this is that last set of results that will be
1026 returned for the indicated search.
1027 </p>
1028 </field>
1029 </params>
1030 </notification>
1031 </domain>
1032 <domain name="edit">
1033 <p>
1034 The edit domain contains commands related to edits that can be
1035 applied to the code.
1036 </p>
1037 <request method="getAssists">
1038 <p>
1039 Return the set of assists that are available at the given
1040 location. An assist is distinguished from a refactoring
1041 primarily by the fact that it affects a single file and does
1042 not require user input in order to be performed.
1043 </p>
1044 <params>
1045 <field name="file">
1046 <ref>FilePath</ref>
1047 <p>
1048 The file containing the code for which assists are being
1049 requested.
1050 </p>
1051 </field>
1052 <field name="offset">
1053 <ref>int</ref>
1054 <p>
1055 The offset of the code for which assists are being
1056 requested.
1057 </p>
1058 </field>
1059 <field name="length">
1060 <ref>int</ref>
1061 <p>
1062 The length of the code for which assists are being
1063 requested.
1064 </p>
1065 </field>
1066 </params>
1067 <result>
1068 <field name="assists">
1069 <list><ref>SourceChange</ref></list>
1070 <p>
1071 The assists that are available at the given location.
1072 </p>
1073 </field>
1074 </result>
1075 </request>
1076 <request method="getAvailableRefactorings">
1077 <p>
1078 Get a list of the kinds of refactorings that are valid for
1079 the given selection in the given file.
1080 </p>
1081 <params>
1082 <field name="file">
1083 <ref>FilePath</ref>
1084 <p>
1085 The file containing the code on which the refactoring
1086 would be based.
1087 </p>
1088 </field>
1089 <field name="offset">
1090 <ref>int</ref>
1091 <p>
1092 The offset of the code on which the refactoring would be
1093 based.
1094 </p>
1095 </field>
1096 <field name="length">
1097 <ref>int</ref>
1098 <p>
1099 The length of the code on which the refactoring would be
1100 based.
1101 </p>
1102 </field>
1103 </params>
1104 <result>
1105 <field name="kinds">
1106 <list><ref>RefactoringKind</ref></list>
1107 <p>
1108 The kinds of refactorings that are valid for the given
1109 selection.
1110 </p>
1111 </field>
1112 </result>
1113 </request>
1114 <request method="getFixes">
1115 <p>
1116 Return the set of fixes that are available for the errors at
1117 a given offset in a given file.
1118 </p>
1119 <params>
1120 <field name="file">
1121 <ref>FilePath</ref>
1122 <p>
1123 The file containing the errors for which fixes are being
1124 requested.
1125 </p>
1126 </field>
1127 <field name="offset">
1128 <ref>int</ref>
1129 <p>
1130 The offset used to select the errors for which fixes
1131 will be returned.
1132 </p>
1133 </field>
1134 </params>
1135 <result>
1136 <field name="fixes">
1137 <list><ref>ErrorFixes</ref></list>
1138 <p>
1139 The fixes that are available for each of the analysis
1140 errors. There is a one-to-one correspondence between the
1141 analysis errors in the request and the lists of changes
1142 in the response. In particular, it is always the case
1143 that errors.length == fixes.length and that fixes[i] is
1144 the list of fixes for the error in errors[i]. The list
1145 of changes corresponding to an error can be empty if
1146 there are no fixes available for that error.
1147 </p>
1148 </field>
1149 </result>
1150 </request>
1151 <request method="getRefactoring">
1152 <p>
1153 Get the changes required to perform a refactoring.
1154 </p>
1155 <params>
1156 <field name="kindId">
1157 <ref>RefactoringKind</ref>
1158 <p>
1159 The identifier of the kind of refactoring to be
1160 performed.
1161 </p>
1162 </field>
1163 <field name="file">
1164 <ref>FilePath</ref>
1165 <p>
1166 The file containing the code involved in the
1167 refactoring.
1168 </p>
1169 </field>
1170 <field name="offset">
1171 <ref>int</ref>
1172 <p>
1173 The offset of the region involved in the refactoring.
1174 </p>
1175 </field>
1176 <field name="length">
1177 <ref>int</ref>
1178 <p>
1179 The length of the region involved in the refactoring.
1180 </p>
1181 </field>
1182 <field name="validateOnly">
1183 <ref>bool</ref>
1184 <p>
1185 True if the client is only requesting that the values of
1186 the options be validated and no change be generated.
1187 </p>
1188 </field>
1189 <field name="options" optional="true">
1190 <ref>object</ref>
1191 <p>
1192 Data used to provide values provided by the user. The
1193 structure of the data is dependent on the kind of
1194 refactoring being performed. The data that is expected is
1195 documented in the section titled <a
1196 href="#refactorings">Refactorings</a>, labeled as
1197 “Options”. This field can be omitted if the refactoring
1198 does not require any options or if the values of those
1199 options are not known.
1200 </p>
1201 </field>
1202 </params>
1203 <result>
1204 <field name="status">
1205 <list><ref>RefactoringProblem</ref></list>
1206 <p>
1207 The status of the refactoring. The array will be empty
1208 if there are no known problems.
1209 </p>
1210 </field>
1211 <field name="feedback" optional="true">
1212 <ref>object</ref>
1213 <p>
1214 Data used to provide feedback to the user. The structure
1215 of the data is dependent on the kind of refactoring
1216 being created. The data that is returned is documented
1217 in the section titled <a
1218 href="#refactorings">Refactorings</a>, labeled as
1219 “Feedback”.
1220 </p>
1221 </field>
1222 <field name="change" optional="true">
1223 <ref>SourceChange</ref>
1224 <p>
1225 The changes that are to be applied to affect the
1226 refactoring. This field will be omitted if there are
1227 problems that prevent a set of changed from being
1228 computed, such as having no options specified for a
1229 refactoring that requires them, or if only validation
1230 was requested.
1231 </p>
1232 </field>
1233 </result>
1234 </request>
1235 </domain>
1236 <domain name="debug">
1237 <p>
1238 The debugging domain contains commands related to providing a
1239 debugging experience.
1240 </p>
1241 <request method="createContext">
1242 <p>
1243 Create a debugging context for the executable file with the
1244 given path. The context that is created will persist until
1245 debug.deleteContext is used to delete it. Clients,
1246 therefore, are responsible for managing the lifetime of
1247 debugging contexts.
1248 </p>
1249 <params>
1250 <field name="contextRoot">
1251 <ref>FilePath</ref>
1252 <p>
1253 The path of the Dart or HTML file that will be launched.
1254 </p>
1255 </field>
1256 </params>
1257 <result>
1258 <field name="id">
1259 <ref>DebugContextId</ref>
1260 <p>
1261 The identifier used to refer to the debugging context
1262 that was created.
1263 </p>
1264 </field>
1265 </result>
1266 </request>
1267 <request method="deleteContext">
1268 <p>
1269 Delete the debugging context with the given identifier. The
1270 context id is no longer valid after this command. The server
1271 is allowed to re-use ids when they are no longer valid.
1272 </p>
1273 <params>
1274 <field name="id">
1275 <ref>DebugContextId</ref>
1276 <p>
1277 The identifier of the debugging context that is to be
1278 deleted.
1279 </p>
1280 </field>
1281 </params>
1282 </request>
1283 <request method="mapUri">
1284 <p>
1285 Map a URI from the debugging context to the file that it
1286 corresponds to, or map a file to the URI that it corresponds
1287 to in the debugging context.
1288 </p>
1289 <p>
1290 Exactly one of the file and uri fields must be provided.
1291 </p>
1292 <params>
1293 <field name="id">
1294 <ref>DebugContextId</ref>
1295 <p>
1296 The identifier of the debugging context in which the URI
1297 is to be mapped.
1298 </p>
1299 </field>
1300 <field name="file" optional="true">
1301 <ref>FilePath</ref>
1302 <p>
1303 The path of the file to be mapped into a URI.
1304 </p>
1305 </field>
1306 <field name="uri" optional="true">
1307 <ref>String</ref>
1308 <p>
1309 The URI to be mapped into a file path.
1310 </p>
1311 </field>
1312 </params>
1313 <result>
1314 <field name="file" optional="true">
1315 <ref>FilePath</ref>
1316 <p>
1317 The file to which the URI was mapped. This field is
1318 omitted if the uri field was not given in the request.
1319 </p>
1320 </field>
1321 <field name="uri" optional="true">
1322 <ref>String</ref>
1323 <p>
1324 The URI to which the file path was mapped. This field is
1325 omitted if the file field was not given in the request.
1326 </p>
1327 </field>
1328 </result>
1329 </request>
1330 <request method="setSubscriptions">
1331 <p>
1332 Subscribe for services. All previous subscriptions are
1333 replaced by the given set of services.
1334 </p>
1335 <p>
1336 It is an error if any of the elements in the list are not
1337 valid services. If there is an error, then the current
1338 subscriptions will remain unchanged.
1339 </p>
1340 <params>
1341 <field name="subscriptions">
1342 <list><ref>DebugService</ref></list>
1343 <p>
1344 A list of the services being subscribed to.
1345 </p>
1346 </field>
1347 </params>
1348 </request>
1349 <notification event="launchData">
1350 <p>
1351 Reports information needed to allow applications within the
1352 given context to be launched.
1353 </p>
1354 <p>
1355 This notification is not subscribed to by default. Clients
1356 can subscribe by including the value "LAUNCH_DATA" in the
1357 list of services passed in a debug.setSubscriptions request.
1358 </p>
1359 <params>
1360 <field name="executables">
1361 <list><ref>ExecutableFile</ref></list>
1362 <p>
1363 A list of the files that are executable in the given
1364 context. This list replaces any previous list provided
1365 for the given context.
1366 </p>
1367 </field>
1368 <field name="dartToHtml">
1369 <map>
1370 <key><ref>FilePath</ref></key>
1371 <value>
1372 <list><ref>FilePath</ref></list>
1373 </value>
1374 </map>
1375 <p>
1376 A mapping from the paths of Dart files that are
1377 referenced by HTML files to a list of the HTML files
1378 that reference the Dart files.
1379 </p>
1380 </field>
1381 <field name="htmlToDart">
1382 <map>
1383 <key><ref>FilePath</ref></key>
1384 <value>
1385 <list><ref>FilePath</ref></list>
1386 </value>
1387 </map>
1388 <p>
1389 A mapping from the paths of HTML files that reference
1390 Dart files to a list of the Dart files they reference.
1391 </p>
1392 </field>
1393 </params>
1394 </notification>
1395 </domain>
1396 <types>
1397 <h2><a name="types">Types</a></h2>
1398 <p>
1399 This section contains descriptions of the data types referenced
1400 in the API’s of the various domains.
1401 </p>
1402 <type name="AnalysisError">
1403 <p>
1404 An indication of an error, warning, or hint that was produced
1405 by the analysis.
1406 </p>
1407 <object>
1408 <field name="severity">
1409 <ref>ErrorSeverity</ref>
1410 <p>
1411 The severity of the error.
1412 </p>
1413 </field>
1414 <field name="type">
1415 <ref>ErrorType</ref>
1416 <p>
1417 The type of the error.
1418 </p>
1419 </field>
1420 <field name="location">
1421 <ref>Location</ref>
1422 <p>
1423 The location associated with the error.
1424 </p>
1425 </field>
1426 <field name="message">
1427 <ref>String</ref>
1428 <p>
1429 The message to be displayed for this error. The message
1430 should indicate what is wrong with the code and why it is
1431 wrong.
1432 </p>
1433 </field>
1434 <field name="correction" optional="true">
1435 <ref>String</ref>
1436 <p>
1437 The correction message to be displayed for this error. The
1438 correction message should indicate how the user can fix
1439 the error. The field is omitted if there is no correction
1440 message associated with the error code.
1441 </p>
1442 </field>
1443 </object>
1444 </type>
1445 <type name="AnalysisOptions">
1446 <p>
1447 A set of options controlling what kind of analysis is to be
1448 performed. If the value of a field is omitted the value of the
1449 option will not be changed.
1450 </p>
1451 <p>
1452 NOTE: These options need to change.
1453 </p>
1454 <object>
1455 <field name="analyzeAngular" optional="true">
1456 <ref>bool</ref>
1457 <p>
1458 True if the client wants Angular code to be analyzed.
1459 </p>
1460 </field>
1461 <field name="analyzePolymer" optional="true">
1462 <ref>bool</ref>
1463 <p>
1464 True if the client wants Polymer code to be analyzed.
1465 </p>
1466 </field>
1467 <field name="enableAsync" optional="true">
1468 <ref>bool</ref>
1469 <p>
1470 True if the client wants to enable support for the
1471 proposed async feature.
1472 </p>
1473 </field>
1474 <field name="enableDeferredLoading" optional="true">
1475 <ref>bool</ref>
1476 <p>
1477 True if the client wants to enable support for the
1478 proposed deferred loading feature.
1479 </p>
1480 </field>
1481 <field name="enableEnums" optional="true">
1482 <ref>bool</ref>
1483 <p>
1484 True if the client wants to enable support for the
1485 proposed enum feature.
1486 </p>
1487 </field>
1488 <field name="generateDart2jsHints" optional="true">
1489 <ref>bool</ref>
1490 <p>
1491 True if hints that are specific to dart2js should be
1492 generated. This option is ignored if either provideErrors
1493 or generateHints is false.
1494 </p>
1495 </field>
1496 <field name="generateHints" optional="true">
1497 <ref>bool</ref>
1498 <p>
1499 True is hints should be generated as part of generating
1500 errors and warnings. This option is ignored if
1501 provideErrors is false.
1502 </p>
1503 </field>
1504 </object>
1505 </type>
1506 <type name="AnalysisService">
1507 <p>
1508 An enumeration of the services provided by the analysis
1509 domain.
1510 </p>
1511 <enum>
1512 <value><code>FOLDING</code></value>
1513 <value><code>HIGHLIGHTS</code></value>
1514 <value><code>NAVIGATION</code></value>
1515 <value><code>OCCURRENCES</code></value>
1516 <value><code>OUTLINE</code></value>
1517 <value><code>OVERRIDES</code></value>
1518 </enum>
1519 </type>
1520 <type name="AnalysisStatus">
1521 <p>
1522 An indication of the current state of analysis.
1523 </p>
1524 <object>
1525 <field name="analyzing">
1526 <ref>bool</ref>
1527 <p>True if analysis is currently being performed.</p>
1528 </field>
1529 <field name="analysisTarget" optional="true">
1530 <ref>String</ref>
1531 <p>
1532 The name of the current target of analysis. This field is
1533 omitted if analyzing is false.
1534 </p>
1535 </field>
1536 </object>
1537 </type>
1538 <type name="CompletionId">
1539 <ref>String</ref>
1540 <p>
1541 An identifier used to associate completion results with a
1542 completion request.
1543 </p>
1544 </type>
1545 <type name="CompletionRelevance">
1546 <p>
1547 An enumeration of the relevance of a completion
1548 suggestion.
1549 </p>
1550 <enum>
1551 <value><code>LOW</code></value>
1552 <value><code>DEFAULT</code></value>
1553 <value><code>HIGH</code></value>
1554 </enum>
1555 </type>
1556 <type name="CompletionSuggestion">
1557 <p>
1558 A suggestion for how to complete partially entered text. Many
1559 of the fields are optional, depending on the kind of element
1560 being suggested.
1561 </p>
1562 <object>
1563 <field name="kind">
1564 <ref>CompletionSuggestionKind</ref>
1565 <p>
1566 The kind of element being suggested.
1567 </p>
1568 </field>
1569 <field name="relevance">
1570 <ref>CompletionRelevance</ref>
1571 <p>
1572 The relevance of this completion suggestion.
1573 </p>
1574 </field>
1575 <field name="completion">
1576 <ref>String</ref>
1577 <p>
1578 The identifier to be inserted if the suggestion is
1579 selected. If the suggestion is for a method or function,
1580 the client might want to additionally insert a template
1581 for the parameters. The information required in order to
1582 do so is contained in other fields.
1583 </p>
1584 </field>
1585 <field name="selectionOffset">
1586 <ref>int</ref>
1587 <p>
1588 The offset, relative to the beginning of the completion,
1589 of where the selection should be placed after insertion.
1590 </p>
1591 </field>
1592 <field name="selectionLength">
1593 <ref>int</ref>
1594 <p>
1595 The number of characters that should be selected after
1596 insertion.
1597 </p>
1598 </field>
1599 <field name="isDeprecated">
1600 <ref>bool</ref>
1601 <p>
1602 True if the suggested element is deprecated.
1603 </p>
1604 </field>
1605 <field name="isPotential">
1606 <ref>bool</ref>
1607 <p>
1608 True if the element is not known to be valid for the
1609 target. This happens if the type of the target is dynamic.
1610 </p>
1611 </field>
1612 <field name="docSummary" optional="true">
1613 <ref>String</ref>
1614 <p>
1615 An abbreviated version of the Dartdoc associated with the
1616 element being suggested, This field is omitted if there is
1617 no Dartdoc associated with the element.
1618 </p>
1619 </field>
1620 <field name="docComplete" optional="true">
1621 <ref>String</ref>
1622 <p>
1623 The Dartdoc associated with the element being suggested,
1624 This field is omitted if there is no Dartdoc associated
1625 with the element.
1626 </p>
1627 </field>
1628 <field name="declaringType" optional="true">
1629 <ref>String</ref>
1630 <p>
1631 The class that declares the element being suggested. This
1632 field is omitted if the suggested element is not a member
1633 of a class.
1634 </p>
1635 </field>
1636 <field name="returnType" optional="true">
1637 <ref>String</ref>
1638 <p>
1639 The return type of the getter, function or method being
1640 suggested. This field is omitted if the suggested element
1641 is not a getter, function or method.
1642 </p>
1643 </field>
1644 <field name="parameterNames" optional="true">
1645 <list><ref>String</ref></list>
1646 <p>
1647 The names of the parameters of the function or method
1648 being suggested. This field is omitted if the suggested
1649 element is not a setter, function or method.
1650 </p>
1651 </field>
1652 <field name="parameterTypes" optional="true">
1653 <list><ref>String</ref></list>
1654 <p>
1655 The types of the parameters of the function or method
1656 being suggested. This field is omitted if the
1657 parameterNames field is omitted.
1658 </p>
1659 </field>
1660 <field name="requiredParameterCount" optional="true">
1661 <ref>int</ref>
1662 <p>
1663 The number of required parameters for the function or
1664 method being suggested. This field is omitted if the
1665 parameterNames field is omitted.
1666 </p>
1667 </field>
1668 <field name="positionalParameterCount" optional="true">
1669 <ref>int</ref>
1670 <p>
1671 The number of positional parameters for the function or
1672 method being suggested. This field is omitted if the
1673 parameterNames field is omitted.
1674 </p>
1675 </field>
1676 <field name="parameterName" optional="true">
1677 <ref>String</ref>
1678 <p>
1679 The name of the optional parameter being suggested. This
1680 field is omitted if the suggestion is not the addition of
1681 an optional argument within an argument list.
1682 </p>
1683 </field>
1684 <field name="parameterType" optional="true">
1685 <ref>String</ref>
1686 <p>
1687 The type of the options parameter being suggested. This
1688 field is omitted if the parameterName field is omitted.
1689 </p>
1690 </field>
1691 </object>
1692 </type>
1693 <type name="CompletionSuggestionKind">
1694 <p>
1695 An enumeration of the kinds of elements that can be included
1696 in a completion suggestion.
1697 </p>
1698 <enum>
1699 <value><code>ARGUMENT_LIST</code></value>
1700 <value><code>CLASS</code></value>
1701 <value><code>CLASS_ALIAS</code></value>
1702 <value><code>CONSTRUCTOR</code></value>
1703 <value><code>FIELD</code></value>
1704 <value><code>FUNCTION</code></value>
1705 <value><code>FUNCTION_TYPE_ALIAS</code></value>
1706 <value><code>GETTER</code></value>
1707 <value><code>IMPORT</code></value>
1708 <value><code>LIBRARY_PREFIX</code></value>
1709 <value><code>LOCAL_VARIABLE</code></value>
1710 <value><code>METHOD</code></value>
1711 <value><code>METHOD_NAME</code></value>
1712 <value><code>NAMED_ARGUMENT</code></value>
1713 <value><code>OPTIONAL_ARGUMENT</code></value>
1714 <value><code>PARAMETER</code></value>
1715 <value><code>SETTER</code></value>
1716 <value><code>TOP_LEVEL_VARIABLE</code></value>
1717 <value><code>TYPE_PARAMETER</code></value>
1718 </enum>
1719 </type>
1720 <type name="ContentChange">
1721 <p>
1722 A description of the change to the content of a file. The
1723 optional fields are omitted if there is no single range of
1724 characters that was modified. If any of the optional fields
1725 are provided then all of the optional fields must be provided.
1726 </p>
1727 <object>
1728 <field name="content">
1729 <ref>String</ref>
1730 <p>
1731 The new content of the file, or null if the content of the
1732 file should be read from disk.
1733 </p>
1734 </field>
1735 <field name="offset" optional="true">
1736 <ref>int</ref>
1737 <p>
1738 The offset of the region that was modified.
1739 </p>
1740 </field>
1741 <field name="oldLength" optional="true">
1742 <ref>int</ref>
1743 <p>
1744 The length of the region that was removed.
1745 </p>
1746 </field>
1747 <field name="newLength" optional="true">
1748 <ref>int</ref>
1749 <p>
1750 The length of the region that was added.
1751 </p>
1752 </field>
1753 </object>
1754 </type>
1755 <type name="DebugContextId">
1756 <ref>String</ref>
1757 <p>
1758 The identifier for a debug context.
1759 </p>
1760 </type>
1761 <type name="DebugService">
1762 <p>
1763 An enumeration of the services provided by the debug
1764 domain.
1765 </p>
1766 <enum>
1767 <value><code>LAUNCH_DATA</code></value>
1768 </enum>
1769 </type>
1770 <type name="Element">
1771 <p>
1772 Information about an element (something that can be declared
1773 in code).
1774 </p>
1775 <object>
1776 <field name="kind">
1777 <ref>ElementKind</ref>
1778 <p>
1779 The kind of the element.
1780 </p>
1781 </field>
1782 <field name="name">
1783 <ref>String</ref>
1784 <p>
1785 The name of the element. This is typically used as the
1786 label in the outline.
1787 </p>
1788 </field>
1789 <field name="location" optional="true">
1790 <ref>Location</ref>
1791 <p>
1792 The location of the name in the declaration of the
1793 element.
1794 </p>
1795 </field>
1796 <field name="flags">
1797 <ref>int</ref>
1798 <p>
1799 A bit-map containing the following flags:
1800 </p>
1801 <ul>
1802 <li>0x01 - set if the element is explicitly or implicitly abstract </li>
1803 <li>0x02 - set if the element was declared to be ‘const’</li>
1804 <li>0x04 - set if the element was declared to be ‘final’</li>
1805 <li>0x08 - set if the element is a static member of a class or is a top-level function or field</li>
1806 <li>0x10 - set if the element is private</li>
1807 <li>0x20 - set if the element is deprecated</li>
1808 </ul>
1809 </field>
1810 <field name="parameters" optional="true">
1811 <ref>String</ref>
1812 <p>
1813 The parameter list for the element. If the element is not
1814 a method or function this field will not be defined. If
1815 the element has zero parameters, this field will have a
1816 value of "()".
1817 </p>
1818 </field>
1819 <field name="returnType" optional="true">
1820 <ref>String</ref>
1821 <p>
1822 The return type of the element. If the element is not a
1823 method or function this field will not be defined. If the
1824 element does not have a declared return type, this field
1825 will contain an empty string.
1826 </p>
1827 </field>
1828 </object>
1829 </type>
1830 <type name="ElementKind">
1831 <p>
1832 An enumeration of the kinds of elements.
1833 </p>
1834 <enum>
1835 <value><code>CLASS</code></value>
1836 <value><code>CLASS_TYPE_ALIAS</code></value>
1837 <value><code>COMPILATION_UNIT</code></value>
1838 <value><code>CONSTRUCTOR</code></value>
1839 <value><code>GETTER</code></value>
1840 <value><code>FIELD</code></value>
1841 <value><code>FUNCTION</code></value>
1842 <value><code>FUNCTION_TYPE_ALIAS</code></value>
1843 <value><code>LIBRARY</code></value>
1844 <value><code>LOCAL_VARIABLE</code></value>
1845 <value><code>METHOD</code></value>
1846 <value><code>SETTER</code></value>
1847 <value><code>TOP_LEVEL_VARIABLE</code></value>
1848 <value><code>TYPE_PARAMETER</code></value>
1849 <value><code>UNKNOWN</code></value>
1850 <value><code>UNIT_TEST_GROUP</code></value>
1851 <value><code>UNIT_TEST_TEST</code></value>
1852 </enum>
1853 </type>
1854 <type name="Error">
1855 <p>
1856 An indication of a problem with the execution of the server,
1857 typically in response to a request. The error codes that can
1858 be returned are documented in the section titled Errors.
1859 </p>
1860 <object>
1861 <field name="code">
1862 <!-- TODO(paulberry): this should be a String, but the
1863 server is currently outputting an int. -->
1864 <ref>int</ref>
1865 <p>
1866 A code that uniquely identifies the error that occurred.
1867 </p>
1868 </field>
1869 <field name="message">
1870 <ref>String</ref>
1871 <p>
1872 A short description of the error.
1873 </p>
1874 </field>
1875 <field name="data" optional="true">
1876 <ref>object</ref>
1877 <p>
1878 Additional data related to the error. This field is
1879 omitted if there is no additional data available.
1880 </p>
1881 </field>
1882 </object>
1883 </type>
1884 <type name="ErrorFixes">
1885 <p>
1886 A list of fixes associated with a specific error
1887 </p>
1888 <object>
1889 <field name="error">
1890 <ref>AnalysisError</ref>
1891 <p>
1892 The error with which the fixes are associated.
1893 </p>
1894 </field>
1895 <field name="fixes">
1896 <list><ref>SourceChange</ref></list>
1897 <p>
1898 The fixes associated with the error.
1899 </p>
1900 </field>
1901 </object>
1902 </type>
1903 <type name="ErrorSeverity">
1904 <p>
1905 An enumeration of the possible severities of analysis
1906 errors.
1907 </p>
1908 <enum>
1909 <value><code>INFO</code></value>
1910 <value><code>WARNING</code></value>
1911 <value><code>ERROR</code></value>
1912 </enum>
1913 </type>
1914 <type name="ErrorType">
1915 <p>
1916 An enumeration of the possible types of analysis errors.
1917 </p>
1918 <enum>
1919 <value><code>COMPILE_TIME_ERROR</code></value>
1920 <value><code>HINT</code></value>
1921 <value><code>STATIC_TYPE_WARNING</code></value>
1922 <value><code>STATIC_WARNING</code></value>
1923 <value><code>SYNTACTIC_ERROR</code></value>
1924 <value><code>TODO</code></value>
1925 </enum>
1926 </type>
1927 <type name="ExecutableFile">
1928 <p>
1929 A description of an executable file.
1930 </p>
1931 <object>
1932 <field name="file">
1933 <ref>FilePath</ref>
1934 <p>
1935 The path of the executable file.
1936 </p>
1937 </field>
1938 <field name="offset">
1939 <ref>ExecutableKind</ref>
1940 <p>
1941 The offset of the region to be highlighted.
1942 </p>
1943 </field>
1944 </object>
1945 </type>
1946 <type name="ExecutableKind">
1947 <p>
1948 An enumeration of the kinds of executable files.
1949 </p>
1950 <enum>
1951 <value><code>CLIENT</code></value>
1952 <value><code>EITHER</code></value>
1953 <value><code>SERVER</code></value>
1954 </enum>
1955 </type>
1956 <type name="FilePath">
1957 <ref>String</ref>
1958 <p>
1959 The absolute path of a file.
1960 </p>
1961 </type>
1962 <type name="FoldingKind">
1963 <p>
1964 An enumeration of the kinds of folding regions.
1965 </p>
1966 <enum>
1967 <value><code>COMMENT</code></value>
1968 <value><code>CLASS_MEMBER</code></value>
1969 <value><code>DIRECTIVES</code></value>
1970 <value><code>DOCUMENTATION_COMMENT</code></value>
1971 <value><code>TOP_LEVEL_DECLARATION</code></value>
1972 </enum>
1973 </type>
1974 <type name="FoldingRegion">
1975 <p>
1976 A description of a region that can be folded.
1977 </p>
1978 <object>
1979 <field name="kind">
1980 <ref>FoldingKind</ref>
1981 <p>
1982 The kind of the region.
1983 </p>
1984 </field>
1985 <field name="offset">
1986 <ref>int</ref>
1987 <p>
1988 The offset of the region to be folded.
1989 </p>
1990 </field>
1991 <field name="length">
1992 <ref>int</ref>
1993 <p>
1994 The length of the region to be folded.
1995 </p>
1996 </field>
1997 </object>
1998 </type>
1999 <type name="HighlightRegion">
2000 <p>
2001 A description of a region that could have special highlighting
2002 associated with it.
2003 </p>
2004 <object>
2005 <field name="type">
2006 <ref>HighlightRegionType</ref>
2007 <p>
2008 The type of highlight associated with the region.
2009 </p>
2010 </field>
2011 <field name="offset">
2012 <ref>int</ref>
2013 <p>
2014 The offset of the region to be highlighted.
2015 </p>
2016 </field>
2017 <field name="length">
2018 <ref>int</ref>
2019 <p>
2020 The length of the region to be highlighted.
2021 </p>
2022 </field>
2023 </object>
2024 </type>
2025 <type name="HighlightRegionType">
2026 <p>
2027 An enumeration of the kinds of highlighting that can be
2028 applied to files.
2029 </p>
2030 <enum>
2031 <value><code>ANNOTATION</code></value>
2032 <value><code>BUILT_IN</code></value>
2033 <value><code>CLASS</code></value>
2034 <value><code>COMMENT_BLOCK</code></value>
2035 <value><code>COMMENT_DOCUMENTATION</code></value>
2036 <value><code>COMMENT_END_OF_LINE</code></value>
2037 <value><code>CONSTRUCTOR</code></value>
2038 <value><code>DIRECTIVE</code></value>
2039 <value><code>DYNAMIC_TYPE</code></value>
2040 <value><code>FIELD</code></value>
2041 <value><code>FIELD_STATIC</code></value>
2042 <value><code>FUNCTION_DECLARATION</code></value>
2043 <value><code>FUNCTION</code></value>
2044 <value><code>FUNCTION_TYPE_ALIAS</code></value>
2045 <value><code>GETTER_DECLARATION</code></value>
2046 <value><code>KEYWORD</code></value>
2047 <value><code>IDENTIFIER_DEFAULT</code></value>
2048 <value><code>IMPORT_PREFIX</code></value>
2049 <value><code>LITERAL_BOOLEAN</code></value>
2050 <value><code>LITERAL_DOUBLE</code></value>
2051 <value><code>LITERAL_INTEGER</code></value>
2052 <value><code>LITERAL_LIST</code></value>
2053 <value><code>LITERAL_MAP</code></value>
2054 <value><code>LITERAL_STRING</code></value>
2055 <value><code>LOCAL_VARIABLE_DECLARATION</code></value>
2056 <value><code>LOCAL_VARIABLE</code></value>
2057 <value><code>METHOD_DECLARATION</code></value>
2058 <value><code>METHOD_DECLARATION_STATIC</code></value>
2059 <value><code>METHOD</code></value>
2060 <value><code>METHOD_STATIC</code></value>
2061 <value><code>PARAMETER</code></value>
2062 <value><code>SETTER_DECLARATION</code></value>
2063 <value><code>TOP_LEVEL_VARIABLE</code></value>
2064 <value><code>TYPE_NAME_DYNAMIC</code></value>
2065 <value><code>TYPE_PARAMETER</code></value>
2066 </enum>
2067 </type>
2068 <type name="HoverInformation">
2069 <p>
2070 The hover information associated with a specific location.
2071 </p>
2072 <object>
2073 <field name="offset">
2074 <ref>int</ref>
2075 <p>
2076 The offset of the range of characters that encompases the
2077 cursor position and has the same hover information as the
2078 cursor position.
2079 </p>
2080 </field>
2081 <field name="length">
2082 <ref>int</ref>
2083 <p>
2084 The length of the range of characters that encompases the
2085 cursor position and has the same hover information as the
2086 cursor position.
2087 </p>
2088 </field>
2089 <field name="containingLibraryPath" optional="true">
2090 <ref>String</ref>
2091 <p>
2092 The path to the defining compilation unit of the library
2093 in which the referenced element is declared. This data is
2094 omitted if there is no referenced element.
2095 </p>
2096 </field>
2097 <field name="containingLibraryName" optional="true">
2098 <ref>String</ref>
2099 <p>
2100 The name of the library in which the referenced element is
2101 declared. This data is omitted if there is no referenced
2102 element.
2103 </p>
2104 </field>
2105 <field name="dartdoc" optional="true">
2106 <ref>String</ref>
2107 <p>
2108 The dartdoc associated with the referenced element. Other
2109 than the removal of the comment delimiters, including
2110 leading asterisks in the case of a block comment, the
2111 dartdoc is unprocessed markdown. This data is omitted if
2112 there is no referenced element.
2113 </p>
2114 </field>
2115 <field name="elementDescription" optional="true">
2116 <ref>String</ref>
2117 <p>
2118 A human-readable description of the element being
2119 referenced. This data is omitted if there is no referenced
2120 element.
2121 </p>
2122 </field>
2123 <field name="elementKind" optional="true">
2124 <ref>String</ref>
2125 <p>
2126 A human-readable description of the kind of element being
2127 referenced (such as “class” or “function type
2128 alias”). This data is omitted if there is no referenced
2129 element.
2130 </p>
2131 </field>
2132 <field name="parameter" optional="true">
2133 <ref>String</ref>
2134 <p>
2135 A human-readable description of the parameter
2136 corresponding to the expression being hovered over. This
2137 data is omitted if the location is not in an argument to a
2138 function.
2139 </p>
2140 </field>
2141 <field name="propagatedType" optional="true">
2142 <ref>String</ref>
2143 <p>
2144 The name of the propagated type of the expression. This
2145 data is omitted if the location does not correspond to an
2146 expression or if there is no propagated type information.
2147 </p>
2148 </field>
2149 <field name="staticType" optional="true">
2150 <ref>String</ref>
2151 <p>
2152 The name of the static type of the expression. This data
2153 is omitted if the location does not correspond to an
2154 expression.
2155 </p>
2156 </field>
2157 </object>
2158 </type>
2159 <type name="LinkedEditGroup">
2160 <p>
2161 A collection of positions that should be linked (edited
2162 simultaneously) for the purposes of updating code after a
2163 source change. For example, if a set of edits introduced a
2164 new variable name, the group would contain all of the
2165 positions of the variable name so that if the client wanted
2166 to let the user edit the variable name after the operation,
2167 all occurrences of the name could be edited simultaneously.
2168 </p>
2169 <object>
2170 <field name="positions">
2171 <list><ref>Position</ref></list>
2172 <p>
2173 The positions of the regions that should be edited
2174 simultaneously.
2175 </p>
2176 </field>
2177 <field name="length">
2178 <ref>int</ref>
2179 <p>
2180 The length of the regions that should be edited
2181 simultaneously.
2182 </p>
2183 </field>
2184 <field name="suggestions">
2185 <list><ref>LinkedEditSuggestion</ref></list>
2186 <p>
2187 Pre-computed suggestions for what every region might
2188 want to be changed to.
2189 </p>
2190 </field>
2191 </object>
2192 </type>
2193 <type name="LinkedEditSuggestion">
2194 <p>
2195 A suggestion of a value that could be used to replace all of
2196 the linked edit regions in a LinkedEditGroup.
2197 </p>
2198 <object>
2199 <field name="value">
2200 <ref>String</ref>
2201 <p>
2202 The value that could be used to replace all of the linked
2203 edit regions.
2204 </p>
2205 </field>
2206 <field name="kind">
2207 <ref>LinkedEditSuggestionKind</ref>
2208 <p>
2209 The kind of value being proposed.
2210 </p>
2211 </field>
2212 </object>
2213 </type>
2214 <type name="LinkedEditSuggestionKind">
2215 <p>
2216 An enumeration of the kind of values that can be suggested
2217 for a linked edit.
2218 </p>
2219 <enum>
2220 <value><code>METHOD</code></value>
2221 <value><code>PARAMETER</code></value>
2222 <value><code>TYPE</code></value>
2223 <value><code>VARIABLE</code></value>
2224 </enum>
2225 </type>
2226 <type name="Location">
2227 <p>
2228 A location (character range) within a file.
2229 </p>
2230 <object>
2231 <field name="file">
2232 <ref>FilePath</ref>
2233 <p>
2234 The file containing the range.
2235 </p>
2236 </field>
2237 <field name="offset">
2238 <ref>int</ref>
2239 <p>
2240 The offset of the range.
2241 </p>
2242 </field>
2243 <field name="length">
2244 <ref>int</ref>
2245 <p>
2246 The length of the range.
2247 </p>
2248 </field>
2249 <field name="startLine">
2250 <ref>int</ref>
2251 <p>
2252 The one-based index of the line containing the first
2253 character of the range.
2254 </p>
2255 </field>
2256 <field name="startColumn">
2257 <ref>int</ref>
2258 <p>
2259 The one-based index of the column containing the first
2260 character of the range.
2261 </p>
2262 </field>
2263 </object>
2264 </type>
2265 <type name="NavigationRegion">
2266 <p>
2267 A description of a region from which the user can navigate to
2268 the declaration of an element.
2269 </p>
2270 <object>
2271 <field name="offset">
2272 <ref>int</ref>
2273 <p>
2274 The offset of the region from which the user can navigate.
2275 </p>
2276 </field>
2277 <field name="length">
2278 <ref>int</ref>
2279 <p>
2280 The length of the region from which the user can navigate.
2281 </p>
2282 </field>
2283 <field name="targets">
2284 <list><ref>Element</ref></list>
2285 <p>
2286 The elements to which the given region is bound. By
2287 opening the declaration of the elements, clients can
2288 implement one form of navigation.
2289 </p>
2290 </field>
2291 </object>
2292 </type>
2293 <type name="Occurrences">
2294 <p>
2295 A description of the references to a single element within a
2296 single file.
2297 </p>
2298 <object>
2299 <field name="element">
2300 <ref>Element</ref>
2301 <p>
2302 The element that was referenced.
2303 </p>
2304 </field>
2305 <field name="offsets">
2306 <list><ref>int</ref></list>
2307 <p>
2308 The offsets of the name of the referenced element within
2309 the file.
2310 </p>
2311 </field>
2312 <field name="length">
2313 <ref>int</ref>
2314 <p>
2315 The length of the name of the referenced element.
2316 </p>
2317 </field>
2318 </object>
2319 </type>
2320 <type name="Outline">
2321 <p>
2322 An node in the outline structure of a file.
2323 </p>
2324 <object>
2325 <field name="element">
2326 <ref>Element</ref>
2327 <p>
2328 A description of the element represented by this node.
2329 </p>
2330 </field>
2331 <field name="offset">
2332 <ref>int</ref>
2333 <p>
2334 The offset of the first character of the element. This is
2335 different than the offset in the Element, which if the
2336 offset of the name of the element. It can be used, for
2337 example, to map locations in the file back to an outline.
2338 </p>
2339 </field>
2340 <field name="length">
2341 <ref>int</ref>
2342 <p>
2343 The length of the element.
2344 </p>
2345 </field>
2346 <field name="children" optional="true">
2347 <list><ref>Outline</ref></list>
2348 <p>
2349 The children of the node. The field will be omitted if the
2350 node has no children.
2351 </p>
2352 </field>
2353 </object>
2354 </type>
2355 <type name="Override">
2356 <p>
2357 A description of a member that overrides an inherited member.
2358 </p>
2359 <object>
2360 <field name="offset">
2361 <ref>int</ref>
2362 <p>
2363 The offset of the name of the overriding member.
2364 </p>
2365 </field>
2366 <field name="length">
2367 <ref>int</ref>
2368 <p>
2369 The length of the name of the overriding member.
2370 </p>
2371 </field>
2372 <field name="superclassMember" optional="true">
2373 <ref>OverriddenMember</ref>
2374 <p>
2375 The member inherited from a superclass that is overridden
2376 by the overriding member. The field is omitted if there is
2377 no superclass member, in which case there must be at least
2378 one interface member.
2379 </p>
2380 </field>
2381 <field name="interfaceMembers" optional="true">
2382 <list><ref>OverriddenMember</ref></list>
2383 <p>
2384 The members inherited from interfaces that are overridden
2385 by the overriding member. The field is omitted if there
2386 are no interface members, in which case there must be a
2387 superclass member.
2388 </p>
2389 </field>
2390 </object>
2391 </type>
2392 <type name="OverriddenMember">
2393 <p>
2394 A description of a member that is being overridden.
2395 </p>
2396 <object>
2397 <field name="element">
2398 <ref>Element</ref>
2399 <p>
2400 The element that is being overridden.
2401 </p>
2402 </field>
2403 <field name="className">
2404 <ref>String</ref>
2405 <p>
2406 The name of the class in which the member is defined.
2407 </p>
2408 </field>
2409 </object>
2410 </type>
2411 <type name="Parameter">
2412 <p>
2413 A description of a parameter.
2414 </p>
2415 <object>
2416 <field name="type">
2417 <ref>String</ref>
2418 <p>
2419 The type that should be given to the parameter.
2420 </p>
2421 </field>
2422 <field name="name">
2423 <ref>String</ref>
2424 <p>
2425 The name that should be given to the parameter.
2426 </p>
2427 </field>
2428 </object>
2429 </type>
2430 <type name="Position">
2431 <p>
2432 A position within a file.
2433 </p>
2434 <object>
2435 <field name="file">
2436 <ref>FilePath</ref>
2437 <p>
2438 The file containing the position.
2439 </p>
2440 </field>
2441 <field name="offset">
2442 <ref>int</ref>
2443 <p>
2444 The offset of the position.
2445 </p>
2446 </field>
2447 </object>
2448 </type>
2449 <type name="RefactoringId">
2450 <ref>String</ref>
2451 <p>
2452 An identifier used to refer to a refactoring operation.
2453 </p>
2454 </type>
2455 <type name="RefactoringKind">
2456 <p>
2457 An enumeration of the kinds of refactorings that can be
2458 created.
2459 </p>
2460 <enum>
2461 <value><code>CONVERT_GETTER_TO_METHOD</code></value>
2462 <value><code>CONVERT_METHOD_TO_GETTER</code></value>
2463 <value><code>EXTRACT_LOCAL_VARIABLE</code></value>
2464 <value><code>EXTRACT_METHOD</code></value>
2465 <value><code>INLINE_LOCAL_VARIABLE</code></value>
2466 <value><code>INLINE_METHOD</code></value>
2467 <value><code>RENAME</code></value>
2468 </enum>
2469 </type>
2470 <type name="RefactoringProblem">
2471 <p>
2472 A description of a problem related to a refactoring.
2473 </p>
2474 <object>
2475 <field name="severity">
2476 <ref>RefactoringProblemSeverity</ref>
2477 <p>
2478 The severity of the problem being represented.
2479 </p>
2480 </field>
2481 <field name="message">
2482 <ref>String</ref>
2483 <p>
2484 A human-readable description of the problem being
2485 represented.
2486 </p>
2487 </field>
2488 <field name="location">
2489 <ref>Location</ref>
2490 <p>
2491 The location of the problem being represented.
2492 </p>
2493 </field>
2494 </object>
2495 </type>
2496 <type name="RefactoringProblemSeverity">
2497 <p>
2498 An enumeration of the severities of problems that can be
2499 returned by the refactoring requests.
2500 </p>
2501 <enum>
2502 <value><code>INFO</code></value>
2503 <value><code>WARNING</code></value>
2504 <value><code>ERROR</code></value>
2505 <value><code>FATAL</code></value>
2506 </enum>
2507 </type>
2508 <type name="SearchId">
2509 <ref>String</ref>
2510 <p>
2511 An identifier used to associate search results with a search
2512 request.
2513 </p>
2514 </type>
2515 <type name="SearchResult">
2516 <p>
2517 A single result from a search request.
2518 </p>
2519 <object>
2520 <field name="location">
2521 <ref>Location</ref>
2522 <p>
2523 The location of the code that matched the search criteria.
2524 </p>
2525 </field>
2526 <field name="kind">
2527 <ref>SearchResultKind</ref>
2528 <p>
2529 The kind of element that was found or the kind of
2530 reference that was found.
2531 </p>
2532 </field>
2533 <field name="isPotential">
2534 <ref>bool</ref>
2535 <p>
2536 True if the result is a potential match but cannot be
2537 confirmed to be a match. For example, if all references to
2538 a method m defined in some class were requested, and a
2539 reference to a method m from an unknown class were found,
2540 it would be marked as being a potential match.
2541 </p>
2542 </field>
2543 <field name="path">
2544 <list><ref>Element</ref></list>
2545 <p>
2546 The elements that contain the result, starting with the
2547 most immediately enclosing ancestor and ending with the
2548 library.
2549 </p>
2550 </field>
2551 </object>
2552 </type>
2553 <type name="SearchResultKind">
2554 <p>
2555 An enumeration of the kinds of search results returned by the
2556 search domain.
2557 </p>
2558 <enum>
2559 <value>
2560 <code>DECLARATION</code>
2561 <p>
2562 The declaration of an element.
2563 </p>
2564 </value>
2565 <value>
2566 <code>INVOCATION</code>
2567 <p>
2568 The invocation of a function or method.
2569 </p>
2570 </value>
2571 <value>
2572 <code>READ</code>
2573 <p>
2574 A reference to a field, parameter or variable where it is being re ad.
2575 </p>
2576 </value>
2577 <value>
2578 <code>READ_WRITE</code>
2579 <p>
2580 A reference to a field, parameter or variable where it is being re ad and written.
2581 </p>
2582 </value>
2583 <value>
2584 <code>REFERENCE</code>
2585 <p>
2586 A reference to an element.
2587 </p>
2588 </value>
2589 <value>
2590 <code>WRITE</code>
2591 <p>
2592 A reference to a field, parameter or variable where it is being wr itten.
2593 </p>
2594 </value>
2595 </enum>
2596 </type>
2597 <type name="ServerService">
2598 <p>
2599 An enumeration of the services provided by the server domain.
2600 </p>
2601 <enum>
2602 <value><code>STATUS</code></value>
2603 </enum>
2604 </type>
2605 <type name="SourceChange">
2606 <p>
2607 A description of a set of edits that implement a single
2608 conceptual change.
2609 </p>
2610 <object>
2611 <field name="message">
2612 <ref>String</ref>
2613 <p>
2614 A human-readable description of the change to be applied.
2615 </p>
2616 </field>
2617 <field name="edits">
2618 <list><ref>SourceFileEdit</ref></list>
2619 <p>
2620 A list of the edits used to effect the change, grouped by
2621 file.
2622 </p>
2623 </field>
2624 <field name="linkedEditGroups">
2625 <list><ref>LinkedEditGroup</ref></list>
2626 <p>
2627 A list of the linked editing groups used to customize
2628 the changes that were made.
2629 </p>
2630 </field>
2631 <field name="selection" optional="true">
2632 <ref>Position</ref>
2633 <p>
2634 The position that should be selected after the edits
2635 have been applied.
2636 </p>
2637 </field>
2638 </object>
2639 </type>
2640 <type name="SourceEdit">
2641 <p>
2642 A description of a single change to a single file.
2643 </p>
2644 <object>
2645 <field name="offset">
2646 <ref>int</ref>
2647 <p>
2648 The offset of the region to be modified.
2649 </p>
2650 </field>
2651 <field name="length">
2652 <ref>int</ref>
2653 <p>
2654 The length of the region to be modified.
2655 </p>
2656 </field>
2657 <field name="replacement">
2658 <ref>String</ref>
2659 <p>
2660 The code that is to replace the specified region in the
2661 original code.
2662 </p>
2663 </field>
2664 </object>
2665 </type>
2666 <type name="SourceFileEdit">
2667 <p>
2668 A description of a set of changes to a single file.
2669 </p>
2670 <object>
2671 <field name="file">
2672 <ref>FilePath</ref>
2673 <p>
2674 The file containing the code to be modified.
2675 </p>
2676 </field>
2677 <field name="edits">
2678 <list><ref>SourceEdit</ref></list>
2679 <p>
2680 A list of the edits used to effect the change.
2681 </p>
2682 </field>
2683 </object>
2684 </type>
2685 <type name="TypeHierarchyItem">
2686 <p>
2687 A representation of a class in a type hierarchy.
2688 </p>
2689 <object>
2690 <field name="classElement">
2691 <ref>Element</ref>
2692 <p>
2693 The class element represented by this item.
2694 </p>
2695 </field>
2696 <field name="displayName" optional="true">
2697 <ref>String</ref>
2698 <p>
2699 The name to be displayed for the class. This field will be
2700 omitted if the display name is the same as the name of the
2701 element. The display name is different if there is
2702 additional type information to be displayed, such as type
2703 arguments.
2704 </p>
2705 </field>
2706 <field name="memberElement" optional="true">
2707 <ref>Element</ref>
2708 <p>
2709 The member in the class corresponding to the member on
2710 which the hierarchy was requested. This field will be
2711 omitted if the hierarchy was not requested for a member or
2712 if the class does not have a corresponding member.
2713 </p>
2714 </field>
2715 <field name="superclass" optional="true">
2716 <ref>int</ref>
2717 <p>
2718 The index of the item representing the superclass of
2719 this class. This field will be omitted if this item
2720 represents the class Object.
2721 </p>
2722 </field>
2723 <field name="interfaces">
2724 <list><ref>int</ref></list>
2725 <p>
2726 The indexes of the items representing the interfaces
2727 implemented by this class. The list will be empty if
2728 there are no implemented interfaces.
2729 </p>
2730 </field>
2731 <field name="mixins">
2732 <list><ref>int</ref></list>
2733 <p>
2734 The indexes of the items representing the mixins
2735 referenced by this class. The list will be empty if
2736 there are no classes mixed in to this class.
2737 </p>
2738 </field>
2739 <field name="subclasses">
2740 <list><ref>int</ref></list>
2741 <p>
2742 The indexes of the items representing the subtypes of
2743 this class. The list will be empty if there are no
2744 subtypes or if this item represents a supertype of the
2745 pivot type.
2746 </p>
2747 </field>
2748 </object>
2749 </type>
2750 </types>
2751 <refactorings>
2752 <h2><a name="refactorings">Refactorings</a></h2>
2753 <p>
2754 This section contains additional information for each kind of
2755 refactoring. In addition to a brief description of the
2756 refactoring, there is a specification of the feedback that is
2757 provided when a refactoring is created using the
2758 edit.createRefactoring request (designed to improve the UX)
2759 and the options that must be set using the
2760 edit.setRefactoringOptions request before the refactoring can
2761 be applied.
2762 </p>
2763 <refactoring kind="CONVERT_GETTER_TO_METHOD">
2764 <p>
2765 Convert a getter into a method by removing the keyword get
2766 and adding an empty parameter list.
2767 </p>
2768 <p>
2769 It is an error if the range contains anything other than all
2770 or part of the name of a single getter.
2771 </p>
2772 </refactoring>
2773 <refactoring kind="CONVERT_METHOD_TO_GETTER">
2774 <p>
2775 Convert a method into a getter by adding the keyword get and
2776 removing the parameter list.
2777 </p>
2778 <p>
2779 It is an error if the range contains anything other than all
2780 or part of the name of a single method or if the method has
2781 a non-empty parameter list.
2782 </p>
2783 </refactoring>
2784 <refactoring kind="EXTRACT_LOCAL_VARIABLE">
2785 <p>
2786 Create a local variable initialized by a specified
2787 expression.
2788 </p>
2789 <p>
2790 It is an error if the range contains anything other than a
2791 complete expression (no partial expressions are allowed).
2792 </p>
2793 <feedback>
2794 <field name="names">
2795 <list><ref>String</ref></list>
2796 <p>
2797 The proposed names for the local variable.
2798 </p>
2799 </field>
2800 <field name="offsets">
2801 <list><ref>int</ref></list>
2802 <p>
2803 The offsets of the expressions that would be replaced by
2804 a reference to the variable.
2805 </p>
2806 </field>
2807 <field name="lengths">
2808 <list><ref>int</ref></list>
2809 <p>
2810 The lengths of the expressions that would be replaced by
2811 a reference to the variable. The lengths correspond to
2812 the offsets. In other words, for a given expression, if
2813 the offset of that expression is offsets[i], then the
2814 length of that expression is lengths[i].
2815 </p>
2816 </field>
2817 </feedback>
2818 <options>
2819 <field name="name">
2820 <ref>String</ref>
2821 <p>
2822 The name that the local variable should be given.
2823 </p>
2824 </field>
2825 <field name="extractAll">
2826 <ref>bool</ref>
2827 <p>
2828 True if all occurrences of the expression within the
2829 scope in which the variable will be defined should be
2830 replaced by a reference to the local variable. The
2831 expression used to initiate the refactoring will always
2832 be replaced.
2833 </p>
2834 </field>
2835 </options>
2836 </refactoring>
2837 <refactoring kind="EXTRACT_METHOD">
2838 <p>
2839 Create a method whose body is the specified expression or
2840 list of statements, possibly augmented with a return
2841 statement.
2842 </p>
2843 <p>
2844 It is an error if the range contains anything other than a
2845 complete expression (no partial expressions are allowed) or
2846 a complete sequence of statements.
2847 </p>
2848 <feedback>
2849 <field name="offset">
2850 <ref>int</ref>
2851 <p>
2852 The offset to the beginning of the expression or
2853 statements that will be extracted.
2854 </p>
2855 </field>
2856 <field name="length">
2857 <ref>int</ref>
2858 <p>
2859 The length of the expression or statements that will be
2860 extracted.
2861 </p>
2862 </field>
2863 <field name="returnType">
2864 <ref>String</ref>
2865 <p>
2866 The proposed return type for the method.
2867 </p>
2868 </field>
2869 <field name="names">
2870 <list><ref>String</ref></list>
2871 <p>
2872 The proposed names for the method.
2873 </p>
2874 </field>
2875 <field name="canCreateGetter">
2876 <ref>bool</ref>
2877 <p>
2878 True if a getter could be created rather than a method.
2879 </p>
2880 </field>
2881 <field name="parameters">
2882 <list><ref>Parameter</ref></list>
2883 <p>
2884 The proposed parameters for the method.
2885 </p>
2886 </field>
2887 <field name="occurrences">
2888 <ref>int</ref>
2889 <p>
2890 The number of times the expression or statements occurs.
2891 </p>
2892 </field>
2893 <field name="offsets">
2894 <list><ref>int</ref></list>
2895 <p>
2896 The offsets of the expressions or statements that would
2897 be replaced by an invocation of the method.
2898 </p>
2899 </field>
2900 <field name="lengths">
2901 <list><ref>int</ref></list>
2902 <p>
2903 The lengths of the expressions or statements that would
2904 be replaced by an invocation of the method. The lengths
2905 correspond to the offsets. In other words, for a given
2906 expression (or block of statements), if the offset of
2907 that expression is offsets[i], then the length of that
2908 expression is lengths[i].
2909 </p>
2910 </field>
2911 </feedback>
2912 <options>
2913 <field name="returnType">
2914 <ref>String</ref>
2915 <p>
2916 The return type that should be defined for the method.
2917 </p>
2918 </field>
2919 <field name="createGetter">
2920 <ref>bool</ref>
2921 <p>
2922 True if a getter should be created rather than a
2923 method. It is an error if this field is true and the
2924 list of parameters is non-empty.
2925 </p>
2926 </field>
2927 <field name="name">
2928 <ref>String</ref>
2929 <p>
2930 The name that the method should be given.
2931 </p>
2932 </field>
2933 <field name="parameters">
2934 <list><ref>Parameter</ref></list>
2935 <p>
2936 The parameters that should be defined for the method.
2937 </p>
2938 </field>
2939 <field name="extractAll">
2940 <ref>bool</ref>
2941 <p>
2942 True if all occurrences of the expression or statements
2943 should be replaced by an invocation of the method. The
2944 expression or statements used to initiate the
2945 refactoring will always be replaced.
2946 </p>
2947 </field>
2948 </options>
2949 </refactoring>
2950 <refactoring kind="INLINE_LOCAL_VARIABLE">
2951 <p>
2952 Inline the initializer expression of a local variable in
2953 place of any references to that variable.
2954 </p>
2955 <p>
2956 It is an error if the range contains anything other than all
2957 or part of the name of a single local variable.
2958 </p>
2959 </refactoring>
2960 <refactoring kind="INLINE_METHOD">
2961 <p>
2962 Inline a method in place of one or all references to that
2963 method.
2964 </p>
2965 <p>
2966 It is an error if the range contains anything other than all
2967 or part of the name of a single method.
2968 </p>
2969 <options>
2970 <field name="deleteSource">
2971 <ref>bool</ref>
2972 <p>
2973 True if the method being inlined should be removed. It
2974 is an error if this field is true and inlineAll is
2975 false.
2976 </p>
2977 </field>
2978 <field name="inlineAll">
2979 <ref>bool</ref>
2980 <p>
2981 True if all invocations of the method should be inlined,
2982 or false if only the invocation site used to create this
2983 refactoring should be inlined.
2984 </p>
2985 </field>
2986 </options>
2987 </refactoring>
2988 <refactoring kind="RENAME">
2989 <p>
2990 Rename a given element and all of the references to that
2991 element.
2992 </p>
2993 <p>
2994 It is an error if the range contains anything other than all
2995 or part of the name of a single function (including methods,
2996 getters and setters), variable (including fields, parameters
2997 and local variables), class or function type.
2998 </p>
2999 <feedback>
3000 <field name="offset">
3001 <ref>int</ref>
3002 <p>
3003 The offset to the beginning of the name selected to be
3004 renamed.
3005 </p>
3006 </field>
3007 <field name="length">
3008 <ref>int</ref>
3009 <p>
3010 The length of the name selected to be renamed.
3011 </p>
3012 </field>
3013 </feedback>
3014 <options>
3015 <field name="newName">
3016 <ref>String</ref>
3017 <p>
3018 The name that the element should have after the
3019 refactoring.
3020 </p>
3021 </field>
3022 </options>
3023 </refactoring>
3024 </refactorings>
3025 <h2>Errors</h2>
3026 <p>
3027 This section contains a list of all of the errors that are
3028 produced by the server and the data that is returned with each.
3029 </p>
3030 <p>
3031 TBD
3032 </p>
3033 </body>
3034 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698