blob: 7bb2fe0d996ba7036b5213274583b13e5f4bf99c [file] [log] [blame]
<!doctype html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Analysis Server API Specification</title>
</head>
<body>
<h1>Analysis Server API Specification</h1>
<h1 style="color:#999999">Version
<version>1.32.7</version>
</h1>
<p>
This document contains a specification of the API provided by the
analysis server. The API in this document is currently under
development. Changes to the API will be accompanied by an update to the
protocol version number according to the principles of semantic
versioning (<a href="https://semver.org/">semver.org</a>).
</p>
<h2>Overview</h2>
<p>
The analysis server API is a bi-directional client-server
API. The API is independent of the transport mechanism used, but
is heavily influenced by a model in which sockets or character
streams are used to transport JSON-RPC encoded information.
</p>
<h3>Transport Mechanism</h3>
<p>
The characters passed to the server are expected to be encoded
using UTF-8.
</p>
<p>
When character streams are used as the transport, messages are
delineated by newlines. This means, in particular, that the JSON
encoding process must not introduce newlines within a
message. Note however that newlines are used in this document
for readability.
</p>
<p>
It is the client's responsibility to read output from the server to
avoid its blocking.
</p>
<p>
To ease interoperability with Lisp-based clients (which may not
be able to easily distinguish between empty lists, empty maps,
and null), client-to-server communication is allowed to replace
any instance of "<tt>{}</tt>" or "<tt>[]</tt>" with null. The
server will always properly represent empty lists as
"<tt>[]</tt>" and empty maps as "<tt>{}</tt>".
</p>
<h3>Communication Structure</h3>
<p>
Clients can make a request of the server and the server will
provide a response for each request that it receives. While many
of the requests that can be made by a client are informational
in nature, we have chosen to always return a response so that
clients can know whether the request was received and was
correct.
</p>
<p>
There is no guarantee concerning the order in which responses
will be returned, but there is a guarantee that the server will
process requests in the order in which they are sent as long as
the transport mechanism also makes this guarantee. Responses can
be returned in an order that is different from the order in
which the requests were received because some requests take
longer to process than others.
</p>
<p>
Every request is required to have two fields and may have two
additional optional fields. The first required field is the ‘id’
field, which is only used by the server to associate a response
with the request that generated the response. The second
required field is the ‘method’ field, which is used to determine
what the server is being requested to do. One optional field is
the ‘params’ field, whose structure is dependent on the method
being requested. The structure of this field is described with
each request for which it is required. The other optional field
is the 'clientRequestTime' field, which is a number indicating
the time at which the client made the request (milliseconds
since epoch). Providing clientRequestTime helps us track
how responsive analysis server is to client requests
and better address any issues that occur.
</p>
<p>
Every response has up to three fields. The first field is the
‘id’ field, which is always present and whose value is the
identifier that was passed to the request that generated the
response. The second field is the ‘error’ field, which is only
present if an error was encountered while processing the
request. The third field is the ‘result’ field, whose structure
is dependent on the method being responded to, and is described
with each request that will produce it.
</p>
<p>
The server can also communicate to the clients by sending a
notification. The purpose of these notifications is to provide
information to clients as it becomes available rather than to
require that clients poll for it. Unless explicitly stated, all
notifications are designed to return the complete information
available at the time the notification is sent; clients are not
required to update previously communicated
results. Consequently, the server can and should return partial
results before all results are available. For example, the
syntactic errors for a file can be returned as soon as the
syntactic analysis is complete, and both syntactic and semantic
errors can be returned together at a later time.
</p>
<p>
Each notification has two fields. The first field is the ‘event’
field, which identifies the kind of notification. The second
field is the ‘params’ field, whose structure is dependent on the
kind of notification being sent. The structure of this field is
described with each notification.
</p>
<p>
In order to be backward compatible, clients should ignore fields that were
not specified in the version of the API on which they were based. Clients
should also use the server.getVersion request to test that the version of
the server supports an API before using it.
</p>
<h3>Eventual Consistency</h3>
<p>
The analysis server satisfies requests under the principle of
<a href="https://en.wikipedia.org/wiki/Eventual_consistency">eventual
consistency</a>.
That is, in some cases it may return responses with the currently available
results while it's catching up with unprocessed changes.
</p>
<h3>Enumerations</h3>
<p>
Responses from the server may include enumerations indicating the kind of a
specific item. The enums may be extended with new values in future versions of
the server so clients should ensure unknown values are handled gracefully, either
ignoring the item or treating it with some default/fallback handling.
</p>
<h3>Changelog</h3>
<h4>1.32.7</h4>
<ul>
<li><tt>HoverInformation.elementDescription</tt> may now include linebreaks to
improve formatting of functions and methods with many parameters. This is not
an API change but may be useful as a signal for clients that previously did their
own formatting.</li>
</ul>
<h4>1.32.6</h4>
<ul>
<li>Added <tt>FoldingKind.PARAMETERS</tt> for folding regions for parameters
that span multiple lines.</li>
</ul>
<h4>1.32.5</h4>
<ul>
<li>Added optional <tt>replacementOffset</tt> and <tt>replacementLength</tt> on
<tt>CompletionSuggestion</tt> to support different per-completion text replacement
ranges (for example when inserting names for arguments, a different range may be
supplied than for completions that are not name labels).</li>
</ul>
<h4>1.32.4</h4>
<ul>
<li>Added <tt>ElementKind.TYPE_ALIAS</tt> and <tt>HighlightRegionType.TYPE_ALIAS</tt>
for non-function type aliases.</li>
</ul>
<h4>1.32.3</h4>
<ul>
<li>Removed the experimental <tt>completion.listTokenDetails</tt> request and
the associated data types.</li>
</ul>
<h4>1.32.2</h4>
<ul>
<li>Added <tt>FoldingKind.COMMENT</tt> for folding regions for blocks of
comments.</li>
</ul>
<h4>1.32.1</h4>
<ul>
<li>Added <tt>CompletionSuggestionKind.PACKAGE_NAME</tt> for Pub package name
completions in <tt>pubspec.yaml</tt>.</li>
</ul>
<h3>Domains</h3>
<p>
For convenience, the API is divided into domains. Each domain is specified
in a separate section below. The specifications of the API’s refer to data
structures beyond the standard JSON primitives. These data structures are
documented in the section titled <a href="#types">Types</a>.
</p>
<toc></toc>
<h3>Command-line Arguments</h3>
<p>
The command-line arguments that can be passed to the server.
</p>
<h4>Options</h4>
<blockquote>
<dl>
<dt>--client-id</dt>
<dd>
<p>
Specifies an identifier associated with the client. Used when
generating error reports.
</p>
<p>
Clients are strongly encouraged to provide this information in
order to improve the quality of information that can be provided
to them.
</p>
</dd>
</dl>
<dl>
<dt>--client-version</dt>
<dd>
<p>
Specifies the version of the client that is communicating with
the server. Used when generating error reports.
</p>
<p>
Clients are strongly encouraged to provide this information in
order to improve the quality of information that can be provided
to them.
</p>
</dd>
</dl>
<dl>
<dt class="deprecated">--no-error-notification</dt>
<dd>
<p><b>Deprecated:</b> clients should no longer pass this option in</p>
Disable notifications about errors (see analysis.error). If this
flag is not specified then notifications will be sent for all
errors produced for all files in the actual analysis roots.
</dd>
</dl>
<dl>
<dt class="deprecated">--no-index</dt>
<dd>
<p><b>Deprecated:</b> clients should no longer pass this option in</p>
This flag used to disable the server from generating an index, but now
it has no effect.
</dd>
</dl>
<dl>
<dt class="deprecated">--file-read-mode</dt>
<dd>
<p><b>Deprecated:</b> clients should no longer pass this option in</p>
An enumeration of the ways files can be read from disk. Some clients
normalize end of line characters which would make the file offset and
range information incorrect. The default option is <tt>as-is</tt>, but
can also be set to <tt>normalize-eol-always</tt>. The default option
(<tt>as-is</tt>) reads files as they are on disk. The
<tt>normalize-eol-always</tt> option does the following:
<ul>
<li>'\r\n' is converted to '\n';</li>
<li>'\r' by itself is converted to '\n';</li>
<li>this happens regardless of the OS editor is running on.</li>
</ul>
</dd>
</dl>
</blockquote>
<domains></domains>
<domain name="server">
<p>
The server domain contains API’s related to the execution of
the server.
</p>
<request method="getVersion">
<p>Return the version number of the analysis server.</p>
<result>
<field name="version">
<ref>String</ref>
<p>The version number of the analysis server.</p>
</field>
</result>
</request>
<request method="shutdown">
<p>
Cleanly shutdown the analysis server. Requests that are
received after this request will not be processed. Requests
that were received before this request, but for which a
response has not yet been sent, will not be responded to. No
further responses or notifications will be sent after the
response to this request has been sent.
</p>
</request>
<request method="setSubscriptions">
<p>
Subscribe for services. All previous subscriptions are
replaced by the given set of services.
</p>
<p>
It is an error if any of the elements in the list are not
valid services. If there is an error, then the current
subscriptions will remain unchanged.
</p>
<params>
<field name="subscriptions">
<list>
<ref>ServerService</ref>
</list>
<p>A list of the services being subscribed to.</p>
</field>
</params>
</request>
<notification event="connected">
<p>
Reports that the server is running. This notification is
issued once after the server has started running but before
any requests are processed to let the client know that it
started correctly.
</p>
<p>
It is not possible to subscribe to or unsubscribe from this
notification.
</p>
<params>
<field name="version">
<ref>String</ref>
<p>The version number of the analysis server.</p>
</field>
<field name="pid">
<ref>int</ref>
<p>The process id of the analysis server process.</p>
</field>
</params>
</notification>
<notification event="error">
<p>
Reports that an unexpected error has occurred while
executing the server. This notification is not used for
problems with specific requests (which are returned as part
of the response) but is used for exceptions that occur while
performing other tasks, such as analysis or preparing
notifications.
</p>
<p>
It is not possible to subscribe to or unsubscribe from this
notification.
</p>
<params>
<field name="isFatal">
<ref>bool</ref>
<p>
True if the error is a fatal error, meaning that the
server will shutdown automatically after sending this
notification.
</p>
</field>
<field name="message">
<ref>String</ref>
<p>
The error message indicating what kind of error was
encountered.
</p>
</field>
<field name="stackTrace">
<ref>String</ref>
<p>
The stack trace associated with the generation of the
error, used for debugging the server.
</p>
</field>
</params>
</notification>
<notification event="log" experimental="true">
<p>
The stream of entries describing events happened in the server.
</p>
<params>
<field name="entry">
<ref>ServerLogEntry</ref>
</field>
</params>
</notification>
<notification event="status">
<p>
Reports the current status of the server. Parameters are
omitted if there has been no change in the status
represented by that parameter.
</p>
<p>
This notification is not subscribed to by default. Clients
can subscribe by including the value <tt>"STATUS"</tt> in
the list of services passed in a server.setSubscriptions
request.
</p>
<params>
<field name="analysis" optional="true">
<ref>AnalysisStatus</ref>
<p>
The current status of analysis, including whether
analysis is being performed and if so what is being
analyzed.
</p>
</field>
<field name="pub" optional="true" deprecated="true">
<ref>PubStatus</ref>
<p>
The current status of pub execution, indicating whether we are
currently running pub.
</p>
<p>
Note: this status type is deprecated, and is no longer sent by
the server.
</p>
</field>
</params>
</notification>
</domain>
<domain name="analysis">
<p>
The analysis domain contains API’s related to the analysis of
files.
</p>
<request method="getErrors">
<p>
Return the errors associated with the given file. If the
errors for the given file have not yet been computed, or the
most recently computed errors for the given file are out of
date, then the response for this request will be delayed
until they have been computed. If some or all of the errors
for the file cannot be computed, then the subset of the
errors that can be computed will be returned and the
response will contain an error to indicate why the errors
could not be computed. If the content of the file changes after this
request was received but before a response could be sent, then an
error of type <tt>CONTENT_MODIFIED</tt> will be generated.
</p>
<p>
This request is intended to be used by clients that cannot
asynchronously apply updated error information. Clients that
<b>can</b> apply error information as it becomes available
should use the information provided by the 'analysis.errors'
notification.
</p>
<p>
If a request is made for a file which does not exist, or
which is not currently subject to analysis (e.g. because it
is not associated with any analysis root specified to
analysis.setAnalysisRoots), an error of type
<tt>GET_ERRORS_INVALID_FILE</tt> will be generated.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file for which errors are being requested.
</p>
</field>
</params>
<result>
<field name="errors">
<list>
<ref>AnalysisError</ref>
</list>
<p>
The errors associated with the file.
</p>
</field>
</result>
</request>
<request method="getHover">
<p>
Return the hover information associate with the given
location. If some or all of the hover information is not
available at the time this request is processed the
information will be omitted from the response.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file in which hover information is being requested.
</p>
</field>
<field name="offset">
<ref>int</ref>
<p>
The offset for which hover information is being requested.
</p>
</field>
</params>
<result>
<field name="hovers">
<list>
<ref>HoverInformation</ref>
</list>
<p>
The hover information associated with the
location. The list will be empty if no information
could be determined for the location. The list can
contain multiple items if the file is being analyzed
in multiple contexts in conflicting ways (such as a
part that is included in multiple libraries).
</p>
</field>
</result>
</request>
<request method="getImportedElements" experimental="true">
<p>
Return a description of all of the elements referenced in a given region
of a given file that come from imported libraries.
</p>
<p>
If a request is made for a file that does not exist, or that is not
currently subject to analysis (e.g. because it is not associated with any
analysis root specified via analysis.setAnalysisRoots), an error of type
<tt>GET_IMPORTED_ELEMENTS_INVALID_FILE</tt> will be generated.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file in which import information is being requested.
</p>
</field>
<field name="offset">
<ref>int</ref>
<p>
The offset of the region for which import information is being
requested.
</p>
</field>
<field name="length">
<ref>int</ref>
<p>
The length of the region for which import information is being
requested.
</p>
</field>
</params>
<result>
<field name="elements">
<list>
<ref>ImportedElements</ref>
</list>
<p>
The information about the elements that are referenced in the
specified region of the specified file that come from imported
libraries.
</p>
</field>
</result>
</request>
<request method="getLibraryDependencies">
<p>
Return library dependency information for use in client-side indexing
and package URI resolution.
</p>
<p>
Clients that are only using the libraries field should consider using the
analyzedFiles notification instead.
</p>
<result>
<field name="libraries">
<list>
<ref>FilePath</ref>
</list>
<p>
A list of the paths of library elements referenced by
files in existing analysis roots.
</p>
</field>
<field name="packageMap">
<map>
<key>
<ref>String</ref>
</key>
<value>
<map>
<key>
<ref>String</ref>
</key>
<value>
<list>
<ref>FilePath</ref>
</list>
</value>
</map>
</value>
</map>
<p>
A mapping from context source roots to package maps which map
package names to source directories for use in client-side
package URI resolution.
</p>
</field>
</result>
</request>
<request method="getNavigation">
<p>
Return the navigation information associated with the given region of
the given file. If the navigation information for the given file has
not yet been computed, or the most recently computed navigation
information for the given file is out of date, then the response for
this request will be delayed until it has been computed. If the
content of the file changes after this request was received but before
a response could be sent, then an error of type
<tt>CONTENT_MODIFIED</tt> will be generated.
</p>
<p>
If a navigation region overlaps (but extends either before or after)
the given region of the file it will be included in the result. This
means that it is theoretically possible to get the same navigation
region in response to multiple requests. Clients can avoid this by
always choosing a region that starts at the beginning of a line and
ends at the end of a (possibly different) line in the file.
</p>
<p>
If a request is made for a file which does not exist, or
which is not currently subject to analysis (e.g. because it
is not associated with any analysis root specified to
analysis.setAnalysisRoots), an error of type
<tt>GET_NAVIGATION_INVALID_FILE</tt> will be generated.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file in which navigation information is being requested.
</p>
</field>
<field name="offset">
<ref>int</ref>
<p>
The offset of the region for which navigation information is being
requested.
</p>
</field>
<field name="length">
<ref>int</ref>
<p>
The length of the region for which navigation information is being
requested.
</p>
</field>
</params>
<result>
<field name="files">
<list>
<ref>FilePath</ref>
</list>
<p>
A list of the paths of files that are referenced by the navigation
targets.
</p>
</field>
<field name="targets">
<list>
<ref>NavigationTarget</ref>
</list>
<p>
A list of the navigation targets that are referenced by the
navigation regions.
</p>
</field>
<field name="regions">
<list>
<ref>NavigationRegion</ref>
</list>
<p>
A list of the navigation regions within the requested region of
the file.
</p>
</field>
</result>
</request>
<request method="getReachableSources" deprecated="true">
<p>
Return the transitive closure of reachable sources for a given file.
</p>
<p>
If a request is made for a file which does not exist, or
which is not currently subject to analysis (e.g. because it
is not associated with any analysis root specified to
analysis.setAnalysisRoots), an error of type
<tt>GET_REACHABLE_SOURCES_INVALID_FILE</tt> will be generated.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file for which reachable source information is being requested.
</p>
</field>
</params>
<result>
<field name="sources">
<map>
<key>
<ref>String</ref>
</key>
<value>
<list>
<ref>String</ref>
</list>
</value>
</map>
<p>
A mapping from source URIs to directly reachable source URIs. For
example,
a file "foo.dart" that imports "bar.dart" would have the corresponding
mapping
{ "file:///foo.dart" : ["file:///bar.dart"] }. If "bar.dart" has
further imports
(or exports) there will be a mapping from the URI "file:///bar.dart"
to them.
To check if a specific URI is reachable from a given file, clients can
check
for its presence in the resulting key set.
</p>
</field>
</result>
</request>
<request method="getSignature" experimental="true">
<p>
Return the signature information associated with the given
location in the given file. If the signature information
for the given file has not yet been computed, or the most
recently computed signature information for the given file
is out of date, then the response for this request will be
delayed until it has been computed.
If a request is made for a file which does not exist, or
which is not currently subject to analysis (e.g. because it
is not associated with any analysis root specified to
analysis.setAnalysisRoots), an error of type
<tt>GET_SIGNATURE_INVALID_FILE</tt> will be generated.
If the location given is not inside the argument list for a
function (including method and constructor) invocation, then
an error of type <tt>GET_SIGNATURE_INVALID_OFFSET</tt> will
be generated. If the location is inside an argument list but
the function is not defined or cannot be determined (such as
a method invocation where the target has type 'dynamic')
then an error of type <tt>GET_SIGNATURE_UNKNOWN_FUNCTION</tt>
will be generated.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file in which signature information is being requested.
</p>
</field>
<field name="offset">
<ref>int</ref>
<p>
The location for which signature information is being requested.
</p>
</field>
</params>
<result>
<field name="name">
<ref>String</ref>
<p>The name of the function being invoked at the given offset.</p>
</field>
<field name="parameters">
<list>
<ref>ParameterInfo</ref>
</list>
<p>A list of information about each of the parameters of the function being invoked.</p>
</field>
<field name="dartdoc" optional="true">
<ref>String</ref>
<p>
The dartdoc associated with the function being invoked. Other
than the removal of the comment delimiters, including leading
asterisks in the case of a block comment, the dartdoc is
unprocessed markdown. This data is omitted if there is no
referenced element, or if the element has no dartdoc.
</p>
</field>
</result>
</request>
<request method="reanalyze">
<p>
Force re-reading of all potentially changed files, re-resolving of all
referenced URIs, and corresponding re-analysis of everything affected in
the current analysis roots.
</p>
</request>
<request method="setAnalysisRoots">
<p>
Sets the root paths used to determine which files to analyze. The set
of files to be analyzed are all of the files in one of the root paths
that are not either explicitly or implicitly excluded. A file is
explicitly excluded if it is in one of the excluded paths. A file is
implicitly excluded if it is in a subdirectory of one of the root
paths where the name of the subdirectory starts with a period (that
is, a hidden directory).
</p>
<p>
Note that this request determines the set of requested
analysis roots. The actual set of analysis roots at any
given time is the intersection of this set with the set of
files and directories actually present on the
filesystem. When the filesystem changes, the actual set of
analysis roots is automatically updated, but the set of
requested analysis roots is unchanged. This means that if
the client sets an analysis root before the root becomes
visible to server in the filesystem, there is no error; once
the server sees the root in the filesystem it will start
analyzing it. Similarly, server will stop analyzing files
that are removed from the file system but they will remain
in the set of requested roots.
</p>
<p>
If an included path represents a file, then server will look
in the directory containing the file for a pubspec.yaml
file. If none is found, then the parents of the directory
will be searched until such a file is found or the root of
the file system is reached. If such a file is found, it will
be used to resolve package: URI’s within the file.
</p>
<params>
<field name="included">
<list>
<ref>FilePath</ref>
</list>
<p>
A list of the files and directories that should be
analyzed.
</p>
</field>
<field name="excluded">
<list>
<ref>FilePath</ref>
</list>
<p>
A list of the files and directories within the
included directories that should not be analyzed.
</p>
</field>
<field name="packageRoots" optional="true">
<map>
<key>
<ref>FilePath</ref>
</key>
<value>
<ref>FilePath</ref>
</value>
</map>
<p>
A mapping from source directories to package roots
that should override the normal package: URI resolution
mechanism.
</p>
<p>
If a package root is a file, then the analyzer
will behave as though that file is a ".packages" file in the
source directory. The effect is the same as specifying the file
as a "--packages" parameter to the Dart VM when
executing any Dart file inside the source directory.
</p>
<p>
Files in any directories that are not overridden by this
mapping have their package: URI's resolved using the
normal pubspec.yaml mechanism. If this field is absent,
or the empty map is specified, that indicates that the
normal pubspec.yaml mechanism should always be used.
</p>
</field>
</params>
</request>
<request method="setGeneralSubscriptions">
<p>
Subscribe for general services (that is, services that are not
specific to individual files). All previous subscriptions are replaced
by the given set of services.
</p>
<p>
It is an error if any of the elements in the list are not valid
services. If there is an error, then the current subscriptions will
remain unchanged.
</p>
<params>
<field name="subscriptions">
<list>
<ref>GeneralAnalysisService</ref>
</list>
<p>A list of the services being subscribed to.</p>
</field>
</params>
</request>
<request method="setPriorityFiles">
<p>
Set the priority files to the files in the given list. A
priority file is a file that is given priority when
scheduling which analysis work to do first. The list
typically contains those files that are visible to the user
and those for which analysis results will have the biggest
impact on the user experience. The order of the files within
the list is significant: the first file will be given higher
priority than the second, the second higher priority than
the third, and so on.
</p>
<p>
Note that this request determines the set of requested
priority files. The actual set of priority files is the
intersection of the requested set of priority files with the
set of files currently subject to analysis. (See
analysis.setSubscriptions for a description of files that
are subject to analysis.)
</p>
<p>
If a requested priority file is a directory it is ignored,
but remains in the set of requested priority files so that
if it later becomes a file it can be included in the set of
actual priority files.
</p>
<params>
<field name="files">
<list>
<ref>FilePath</ref>
</list>
<p>
The files that are to be a priority for analysis.
</p>
</field>
</params>
</request>
<request method="setSubscriptions">
<p>
Subscribe for services that are specific to individual files.
All previous subscriptions are replaced by the current set of
subscriptions. If a given service is not included as a key in the map
then no files will be subscribed to the service, exactly as if the
service had been included in the map with an explicit empty list of
files.
</p>
<p>
Note that this request determines the set of requested
subscriptions. The actual set of subscriptions at any given
time is the intersection of this set with the set of files
currently subject to analysis. The files currently subject
to analysis are the set of files contained within an actual
analysis root but not excluded, plus all of the files
transitively reachable from those files via import, export
and part directives. (See analysis.setAnalysisRoots for an
explanation of how the actual analysis roots are
determined.) When the actual analysis roots change, the
actual set of subscriptions is automatically updated, but
the set of requested subscriptions is unchanged.
</p>
<p>
If a requested subscription is a directory it is ignored,
but remains in the set of requested subscriptions so that if
it later becomes a file it can be included in the set of
actual subscriptions.
</p>
<p>
It is an error if any of the keys in the map are not valid
services. If there is an error, then the existing
subscriptions will remain unchanged.
</p>
<params>
<field name="subscriptions">
<map>
<key>
<ref>AnalysisService</ref>
</key>
<value>
<list>
<ref>FilePath</ref>
</list>
</value>
</map>
<p>
A table mapping services to a list of the files being
subscribed to the service.
</p>
</field>
</params>
</request>
<request method="updateContent">
<p>
Update the content of one or more files. Files that were
previously updated but not included in this update remain
unchanged. This effectively represents an overlay of the
filesystem. The files whose content is overridden are
therefore seen by server as being files with the given
content, even if the files do not exist on the filesystem or
if the file path represents the path to a directory on the
filesystem.
</p>
<params>
<field name="files">
<map>
<key>
<ref>FilePath</ref>
</key>
<value>
<union field="type">
<ref>AddContentOverlay</ref>
<ref>ChangeContentOverlay</ref>
<ref>RemoveContentOverlay</ref>
</union>
</value>
</map>
<p>
A table mapping the files whose content has changed to a
description of the content change.
</p>
</field>
</params>
<result>
</result>
</request>
<request method="updateOptions" deprecated="true">
<p><b>Deprecated:</b> all of the options can be set by users in
an analysis options file.</p>
<p>
Update the options controlling analysis based on the given
set of options. Any options that are not included in the
analysis options will not be changed. If there are options
in the analysis options that are not valid, they will be
silently ignored.
</p>
<params>
<field name="options">
<ref>AnalysisOptions</ref>
<p>
The options that are to be used to control analysis.
</p>
</field>
</params>
</request>
<notification event="analyzedFiles">
<p>
Reports the paths of the files that are being analyzed.
</p>
<p>
This notification is not subscribed to by default. Clients can
subscribe by including the value <tt>"ANALYZED_FILES"</tt> in the list
of services passed in an analysis.setGeneralSubscriptions request.
</p>
<params>
<field name="directories">
<list>
<ref>FilePath</ref>
</list>
<p>
A list of the paths of the files that are being analyzed.
</p>
</field>
</params>
</notification>
<notification event="closingLabels">
<p>
Reports closing labels relevant to a given file.
</p>
<p>
This notification is not subscribed to by default. Clients
can subscribe by including the value <tt>"CLOSING_LABELS"</tt>
in the list of services passed in an
analysis.setSubscriptions request.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file the closing labels relate to.
</p>
</field>
<field name="labels">
<list>
<ref>ClosingLabel</ref>
</list>
<p>
Closing labels relevant to the file. Each item
represents a useful label associated with some range
with may be useful to display to the user within the editor
at the end of the range to indicate what construct is closed
at that location. Closing labels include constructor/method
calls and List arguments that span multiple lines.
Note that the ranges that are returned can overlap
each other because they may be associated with
constructs that can be nested.
</p>
</field>
</params>
</notification>
<notification event="errors">
<p>
Reports the errors associated with a given file. The set of
errors included in the notification is always a complete
list that supersedes any previously reported errors.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file containing the errors.
</p>
</field>
<field name="errors">
<list>
<ref>AnalysisError</ref>
</list>
<p>
The errors contained in the file.
</p>
</field>
</params>
</notification>
<notification event="flushResults">
<p>
Reports that any analysis results that were previously
associated with the given files should be considered to be
invalid because those files are no longer being analyzed,
either because the analysis root that contained it is no
longer being analyzed or because the file no longer exists.
</p>
<p>
If a file is included in this notification and at some later
time a notification with results for the file is received,
clients should assume that the file is once again being
analyzed and the information should be processed.
</p>
<p>
It is not possible to subscribe to or unsubscribe from this
notification.
</p>
<params>
<field name="files">
<list>
<ref>FilePath</ref>
</list>
<p>
The files that are no longer being analyzed.
</p>
</field>
</params>
</notification>
<notification event="folding">
<p>
Reports the folding regions associated with a given
file. Folding regions can be nested, but will not be
overlapping. Nesting occurs when a foldable element, such as
a method, is nested inside another foldable element such as
a class.
</p>
<p>
This notification is not subscribed to by default. Clients
can subscribe by including the value <tt>"FOLDING"</tt> in
the list of services passed in an analysis.setSubscriptions
request.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file containing the folding regions.
</p>
</field>
<field name="regions">
<list>
<ref>FoldingRegion</ref>
</list>
<p>
The folding regions contained in the file.
</p>
</field>
</params>
</notification>
<notification event="highlights">
<p>
Reports the highlight regions associated with a given file.
</p>
<p>
This notification is not subscribed to by default. Clients
can subscribe by including the value <tt>"HIGHLIGHTS"</tt>
in the list of services passed in an
analysis.setSubscriptions request.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file containing the highlight regions.
</p>
</field>
<field name="regions">
<list>
<ref>HighlightRegion</ref>
</list>
<p>
The highlight regions contained in the file. Each
highlight region represents a particular syntactic or
semantic meaning associated with some range. Note that
the highlight regions that are returned can overlap
other highlight regions if there is more than one
meaning associated with a particular region.
</p>
</field>
</params>
</notification>
<notification event="implemented">
<p>
Reports the classes that are implemented or extended and
class members that are implemented or overridden in a file.
</p>
<p>
This notification is not subscribed to by default. Clients
can subscribe by including the value <tt>"IMPLEMENTED"</tt> in
the list of services passed in an analysis.setSubscriptions
request.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file with which the implementations are associated.
</p>
</field>
<field name="classes">
<list>
<ref>ImplementedClass</ref>
</list>
<p>
The classes defined in the file that are implemented or extended.
</p>
</field>
<field name="members">
<list>
<ref>ImplementedMember</ref>
</list>
<p>
The member defined in the file that are implemented or overridden.
</p>
</field>
</params>
</notification>
<notification event="invalidate">
<p>
Reports that the navigation information associated with a region of a
single file has become invalid and should be re-requested.
</p>
<p>
This notification is not subscribed to by default. Clients can
subscribe by including the value <tt>"INVALIDATE"</tt> in the list of
services passed in an analysis.setSubscriptions request.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file whose information has been invalidated.
</p>
</field>
<field name="offset">
<ref>int</ref>
<p>
The offset of the invalidated region.
</p>
</field>
<field name="length">
<ref>int</ref>
<p>
The length of the invalidated region.
</p>
</field>
<field name="delta">
<ref>int</ref>
<p>
The delta to be applied to the offsets in information that follows
the invalidated region in order to update it so that it doesn't
need to be re-requested.
</p>
</field>
</params>
</notification>
<notification event="navigation">
<p>
Reports the navigation targets associated with a given file.
</p>
<p>
This notification is not subscribed to by default. Clients
can subscribe by including the value <tt>"NAVIGATION"</tt>
in the list of services passed in an
analysis.setSubscriptions request.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file containing the navigation regions.
</p>
</field>
<field name="regions">
<list>
<ref>NavigationRegion</ref>
</list>
<p>
The navigation regions contained in the file.
The regions are sorted by their offsets.
Each navigation region represents a list of targets
associated with some range. The lists will usually
contain a single target, but can contain more in the
case of a part that is included in multiple libraries
or in Dart code that is compiled against multiple
versions of a package. Note that the navigation
regions that are returned do not overlap other
navigation regions.
</p>
</field>
<field name="targets">
<list>
<ref>NavigationTarget</ref>
</list>
<p>
The navigation targets referenced in the file.
They are referenced by <tt>NavigationRegion</tt>s by their
index in this array.
</p>
</field>
<field name="files">
<list>
<ref>FilePath</ref>
</list>
<p>
The files containing navigation targets referenced in the file.
They are referenced by <tt>NavigationTarget</tt>s by their
index in this array.
</p>
</field>
</params>
</notification>
<notification event="occurrences">
<p>
Reports the occurrences of references to elements within a
single file.
</p>
<p>
This notification is not subscribed to by default. Clients
can subscribe by including the value <tt>"OCCURRENCES"</tt>
in the list of services passed in an
analysis.setSubscriptions request.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file in which the references occur.
</p>
</field>
<field name="occurrences">
<list>
<ref>Occurrences</ref>
</list>
<p>
The occurrences of references to elements within the
file.
</p>
</field>
</params>
</notification>
<notification event="outline">
<p>
Reports the outline associated with a single file.
</p>
<p>
This notification is not subscribed to by default. Clients
can subscribe by including the value <tt>"OUTLINE"</tt> in
the list of services passed in an analysis.setSubscriptions
request.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file with which the outline is associated.
</p>
</field>
<field name="kind">
<ref>FileKind</ref>
<p>
The kind of the file.
</p>
</field>
<field name="libraryName" optional="true">
<ref>String</ref>
<p>
The name of the library defined by the file using a "library"
directive, or referenced by a "part of" directive. If both
"library" and "part of" directives are present, then the
"library" directive takes precedence.
This field will be omitted if the file has neither "library"
nor "part of" directives.
</p>
</field>
<field name="outline">
<ref>Outline</ref>
<p>
The outline associated with the file.
</p>
</field>
</params>
</notification>
<notification event="overrides">
<p>
Reports the overriding members in a file.
</p>
<p>
This notification is not subscribed to by default. Clients
can subscribe by including the value <tt>"OVERRIDES"</tt> in
the list of services passed in an analysis.setSubscriptions
request.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file with which the overrides are associated.
</p>
</field>
<field name="overrides">
<list>
<ref>Override</ref>
</list>
<p>
The overrides associated with the file.
</p>
</field>
</params>
</notification>
</domain>
<domain name="completion">
<p>
The code completion domain contains commands related to
getting code completion suggestions.
</p>
<request method="getSuggestions">
<p>
Request that completion suggestions for the given offset in
the given file be returned.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file containing the point at which suggestions are
to be made.
</p>
</field>
<field name="offset">
<ref>int</ref>
<p>
The offset within the file at which suggestions are to
be made.
</p>
</field>
</params>
<result>
<field name="id">
<ref>CompletionId</ref>
<p>
The identifier used to associate results with this
completion request.
</p>
</field>
</result>
</request>
<request method="setSubscriptions">
<p>
Subscribe for completion services. All previous subscriptions are
replaced by the given set of services.
</p>
<p>
It is an error if any of the elements in the list are not valid
services. If there is an error, then the current subscriptions will
remain unchanged.
</p>
<params>
<field name="subscriptions">
<list>
<ref>CompletionService</ref>
</list>
<p>A list of the services being subscribed to.</p>
</field>
</params>
</request>
<request method="registerLibraryPaths" deprecated="true">
<p>
The client can make this request to express interest in certain
libraries to receive completion suggestions from based on the client path.
If this request is received before the client has used
'completion.setSubscriptions' to subscribe to the <tt>AVAILABLE_SUGGESTION_SETS</tt>
service, then an error of type <tt>NOT_SUBSCRIBED_TO_AVAILABLE_SUGGESTION_SETS</tt>
will be generated. All previous paths are replaced by the given set of paths.
</p>
<params>
<field name="paths">
<list>
<ref>LibraryPathSet</ref>
</list>
<p>
A list of objects each containing a path and the additional libraries from which
the client is interested in receiving completion suggestions.
If one configured path is beneath another, the descendent
will override the ancestors' configured libraries of interest.
</p>
</field>
</params>
</request>
<request method="getSuggestionDetails">
<p>
Clients must make this request when the user has selected a completion
suggestion from an <tt>AvailableSuggestionSet</tt>. Analysis server will respond with
the text to insert as well as any <tt>SourceChange</tt> that needs to be applied
in case the completion requires an additional import to be added. It is an error
if the id is no longer valid, for instance if the library has been removed after
the completion suggestion is accepted.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The path of the file into which this completion is being inserted.
</p>
</field>
<field name="id">
<ref>int</ref>
<p>
The identifier of the <tt>AvailableSuggestionSet</tt> containing
the selected label.
</p>
</field>
<field name="label">
<ref>String</ref>
<p>
The label from the <tt>AvailableSuggestionSet</tt> with the `id`
for which insertion information is requested.
</p>
</field>
<field name="offset">
<ref>int</ref>
<p>
The offset in the file where the completion will be inserted.
</p>
</field>
</params>
<result>
<field name="completion">
<ref>String</ref>
<p>
The full text to insert, including any optional import prefix.
</p>
</field>
<field name="change" optional="true">
<ref>SourceChange</ref>
<p>
A change for the client to apply in case the library containing
the accepted completion suggestion needs to be imported. The field
will be omitted if there are no additional changes that need to be made.
</p>
</field>
</result>
</request>
<notification event="results">
<p>
Reports the completion suggestions that should be presented
to the user. The set of suggestions included in the
notification is always a complete list that supersedes any
previously reported suggestions.
</p>
<params>
<field name="id">
<ref>CompletionId</ref>
<p>
The id associated with the completion.
</p>
</field>
<field name="replacementOffset">
<ref>int</ref>
<p>
The offset of the start of the text to be
replaced. This will be different than the offset used
to request the completion suggestions if there was a
portion of an identifier before the original
offset. In particular, the replacementOffset will be
the offset of the beginning of said identifier.
</p>
</field>
<field name="replacementLength">
<ref>int</ref>
<p>
The length of the text to be replaced if the remainder
of the identifier containing the cursor is to be
replaced when the suggestion is applied (that is, the
number of characters in the existing identifier).
</p>
</field>
<field name="results">
<list>
<ref>CompletionSuggestion</ref>
</list>
<p>
The completion suggestions being reported. The
notification contains all possible completions at the
requested cursor position, even those that do not match
the characters the user has already typed. This allows
the client to respond to further keystrokes from the
user without having to make additional requests.
</p>
</field>
<field name="isLast">
<ref>bool</ref>
<p>
True if this is that last set of results that will be
returned for the indicated completion.
</p>
</field>
<field name="libraryFile" optional="true">
<ref>FilePath</ref>
<p>
The library file that contains the file where completion was
requested. The client might use it for example together with the
<tt>existingImports</tt> notification to filter out available
suggestions. If there were changes to existing imports in the library,
the corresponding <tt>existingImports</tt> notification will be sent
before the completion notification.
</p>
</field>
<field name="includedSuggestionSets" optional="true">
<list>
<ref>IncludedSuggestionSet</ref>
</list>
<p>
References to <tt>AvailableSuggestionSet</tt> objects previously sent
to the client. The client can include applicable names from the
referenced library in code completion suggestions.
</p>
</field>
<field name="includedElementKinds" optional="true">
<list>
<ref>ElementKind</ref>
</list>
<p>
The client is expected to check this list against the
<tt>ElementKind</tt> sent in <tt>IncludedSuggestionSet</tt> to decide
whether or not these symbols should should be presented to the user.
</p>
</field>
<field name="includedSuggestionRelevanceTags" optional="true">
<list>
<ref>IncludedSuggestionRelevanceTag</ref>
</list>
<p>
The client is expected to check this list against the values of the
field <tt>relevanceTags</tt> of <tt>AvailableSuggestion</tt> to
decide if the suggestion should be given a different relevance than
the <tt>IncludedSuggestionSet</tt> that contains it. This might be
used for example to give higher relevance to suggestions of matching
types.
</p>
<p>
If an <tt>AvailableSuggestion</tt> has relevance tags that match more
than one <tt>IncludedSuggestionRelevanceTag</tt>, the maximum
relevance boost is used.
</p>
</field>
</params>
</notification>
<notification event="availableSuggestions">
<p>
Reports the pre-computed, candidate completions from symbols defined
in a corresponding library. This notification may be sent multiple times.
When a notification is processed, clients should replace any previous
information about the libraries in the list of changedLibraries, discard
any information about the libraries in the list of removedLibraries, and
preserve any previously received information about any libraries that are
not included in either list.
</p>
<params>
<field name="changedLibraries" optional="true">
<list>
<ref>AvailableSuggestionSet</ref>
</list>
<p>
A list of pre-computed, potential completions coming from
this set of completion suggestions.
</p>
</field>
<field name="removedLibraries" optional="true">
<list>
<ref>int</ref>
</list>
<p>
A list of library ids that no longer apply.
</p>
</field>
</params>
</notification>
<notification event="existingImports">
<p>
Reports existing imports in a library. This notification may be sent
multiple times for a library. When a notification is processed, clients
should replace any previous information for the library.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The defining file of the library.
</p>
</field>
<field name="imports">
<ref>ExistingImports</ref>
<p>
The existing imports in the library.
</p>
</field>
</params>
</notification>
</domain>
<domain name="search">
<p>
The search domain contains commands related to searches that
can be performed against the code base.
</p>
<request method="findElementReferences">
<p>
Perform a search for references to the element defined or
referenced at the given offset in the given file.
</p>
<p>
An identifier is returned immediately, and individual
results will be returned via the search.results notification
as they become available.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file containing the declaration of or reference to
the element used to define the search.
</p>
</field>
<field name="offset">
<ref>int</ref>
<p>
The offset within the file of the declaration of or
reference to the element.
</p>
</field>
<field name="includePotential">
<ref>bool</ref>
<p>
True if potential matches are to be included in the
results.
</p>
</field>
</params>
<result>
<field name="id" optional="true">
<ref>SearchId</ref>
<p>
The identifier used to associate results with this
search request.
</p>
<p>
If no element was found at the given location, this
field will be absent, and no results will be reported
via the search.results notification.
</p>
</field>
<field name="element" optional="true">
<ref>Element</ref>
<p>
The element referenced or defined at the given offset
and whose references will be returned in the search
results.
</p>
<p>
If no element was found at the given location, this
field will be absent.
</p>
</field>
</result>
</request>
<request method="findMemberDeclarations">
<p>
Perform a search for declarations of members whose name is
equal to the given name.
</p>
<p>
An identifier is returned immediately, and individual
results will be returned via the search.results notification
as they become available.
</p>
<params>
<field name="name">
<ref>String</ref>
<p>
The name of the declarations to be found.
</p>
</field>
</params>
<result>
<field name="id">
<ref>SearchId</ref>
<p>
The identifier used to associate results with this
search request.
</p>
</field>
</result>
</request>
<request method="findMemberReferences">
<p>
Perform a search for references to members whose name is
equal to the given name. This search does not check to see
that there is a member defined with the given name, so it is
able to find references to undefined members as well.
</p>
<p>
An identifier is returned immediately, and individual
results will be returned via the search.results notification
as they become available.
</p>
<params>
<field name="name">
<ref>String</ref>
<p>
The name of the references to be found.
</p>
</field>
</params>
<result>
<field name="id">
<ref>SearchId</ref>
<p>
The identifier used to associate results with this
search request.
</p>
</field>
</result>
</request>
<request method="findTopLevelDeclarations">
<p>
Perform a search for declarations of top-level elements
(classes, typedefs, getters, setters, functions and fields)
whose name matches the given pattern.
</p>
<p>
An identifier is returned immediately, and individual
results will be returned via the search.results notification
as they become available.
</p>
<params>
<field name="pattern">
<ref>String</ref>
<p>
The regular expression used to match the names of the
declarations to be found.
</p>
</field>
</params>
<result>
<field name="id">
<ref>SearchId</ref>
<p>
The identifier used to associate results with this
search request.
</p>
</field>
</result>
</request>
<request method="getElementDeclarations" experimental="true">
<p>
Return top-level and class member declarations.
</p>
<params>
<field name="file" optional="true">
<ref>FilePath</ref>
<p>
If this field is provided, return only declarations in this file.
If this field is missing, return declarations in all files.
</p>
</field>
<field name="pattern" optional="true">
<ref>String</ref>
<p>
The regular expression used to match the names of declarations.
If this field is missing, return all declarations.
</p>
</field>
<field name="maxResults" optional="true">
<ref>int</ref>
<p>
The maximum number of declarations to return.
If this field is missing, return all matching declarations.
</p>
</field>
</params>
<result>
<field name="declarations">
<list>
<ref>ElementDeclaration</ref>
</list>
<p>
The list of declarations.
</p>
</field>
<field name="files">
<list>
<ref>FilePath</ref>
</list>
<p>
The list of the paths of files with declarations.
</p>
</field>
</result>
</request>
<request method="getTypeHierarchy">
<p>
Return the type hierarchy of the class declared or
referenced at the given location.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file containing the declaration or reference to the
type for which a hierarchy is being requested.
</p>
</field>
<field name="offset">
<ref>int</ref>
<p>
The offset of the name of the type within the file.
</p>
</field>
<field name="superOnly" optional="true">
<ref>bool</ref>
<p>
True if the client is only requesting superclasses and
interfaces hierarchy.
</p>
</field>
</params>
<result>
<field name="hierarchyItems" optional="true">
<list>
<ref>TypeHierarchyItem</ref>
</list>
<p>
A list of the types in the requested hierarchy. The
first element of the list is the item representing the
type for which the hierarchy was requested. The index of
other elements of the list is unspecified, but
correspond to the integers used to reference supertype
and subtype items within the items.
</p>
<p>
This field will be absent if the code at the given file
and offset does not represent a type, or if the file has
not been sufficiently analyzed to allow a type hierarchy
to be produced.
</p>
</field>
</result>
</request>
<notification event="results">
<p>
Reports some or all of the results of performing a requested
search. Unlike other notifications, this notification
contains search results that should be added to any
previously received search results associated with the same
search id.
</p>
<params>
<field name="id">
<ref>SearchId</ref>
<p>
The id associated with the search.
</p>
</field>
<field name="results">
<list>
<ref>SearchResult</ref>
</list>
<p>
The search results being reported.
</p>
</field>
<field name="isLast">
<ref>bool</ref>
<p>
True if this is that last set of results that will be
returned for the indicated search.
</p>
</field>
</params>
</notification>
</domain>
<domain name="edit">
<p>
The edit domain contains commands related to edits that can be
applied to the code.
</p>
<request method="format">
<p>
Format the contents of a single file. The currently selected region of
text is passed in so that the selection can be preserved across the
formatting operation. The updated selection will be as close to
matching the original as possible, but whitespace at the beginning or
end of the selected region will be ignored. If preserving selection
information is not required, zero (0) can be specified for both the
selection offset and selection length.
</p>
<p>
If a request is made for a file which does not exist, or which is not
currently subject to analysis (e.g. because it is not associated with
any analysis root specified to analysis.setAnalysisRoots), an error of
type <tt>FORMAT_INVALID_FILE</tt> will be generated. If the source
contains syntax errors, an error of type <tt>FORMAT_WITH_ERRORS</tt>
will be generated.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file containing the code to be formatted.
</p>
</field>
<field name="selectionOffset">
<ref>int</ref>
<p>
The offset of the current selection in the file.
</p>
</field>
<field name="selectionLength">
<ref>int</ref>
<p>
The length of the current selection in the file.
</p>
</field>
<!--
<field name="selectionOnly" optional="true">
<ref>bool</ref>
<p>
True if the code to be formatted should be limited to the selected
text (or the smallest portion of text that encloses the selected
text that can be formatted).
</p>
</field>
-->
<field name="lineLength" optional="true">
<ref>int</ref>
<p>
The line length to be used by the formatter.
</p>
</field>
</params>
<result>
<field name="edits">
<list>
<ref>SourceEdit</ref>
</list>
<p>
The edit(s) to be applied in order to format the code. The list
will be empty if the code was already formatted (there are no
changes).
</p>
</field>
<field name="selectionOffset">
<ref>int</ref>
<p>
The offset of the selection after formatting the code.
</p>
</field>
<field name="selectionLength">
<ref>int</ref>
<p>
The length of the selection after formatting the code.
</p>
</field>
</result>
</request>
<request method="getAssists">
<p>
Return the set of assists that are available at the given
location. An assist is distinguished from a refactoring
primarily by the fact that it affects a single file and does
not require user input in order to be performed.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file containing the code for which assists are being
requested.
</p>
</field>
<field name="offset">
<ref>int</ref>
<p>
The offset of the code for which assists are being
requested.
</p>
</field>
<field name="length">
<ref>int</ref>
<p>
The length of the code for which assists are being
requested.
</p>
</field>
</params>
<result>
<field name="assists">
<list>
<ref>SourceChange</ref>
</list>
<p>
The assists that are available at the given location.
</p>
</field>
</result>
</request>
<request method="getAvailableRefactorings">
<p>
Get a list of the kinds of refactorings that are valid for
the given selection in the given file.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file containing the code on which the refactoring
would be based.
</p>
</field>
<field name="offset">
<ref>int</ref>
<p>
The offset of the code on which the refactoring would be
based.
</p>
</field>
<field name="length">
<ref>int</ref>
<p>
The length of the code on which the refactoring would be
based.
</p>
</field>
</params>
<result>
<field name="kinds">
<list>
<ref>RefactoringKind</ref>
</list>
<p>
The kinds of refactorings that are valid for the given
selection.
</p>
</field>
</result>
</request>
<request method="bulkFixes" experimental="true">
<p>
Analyze the specified sources for fixes that can be applied in bulk
and return a set of suggested edits for those sources.
These edits may include changes to sources outside the set
of specified sources if a change in a specified source requires it.
</p>
<params>
<field name="included">
<list>
<ref>FilePath</ref>
</list>
<p>
A list of the files and directories for which edits should be
suggested.
</p>
<p>
If a request is made with a path that is invalid, e.g. is not absolute
and normalized, an error of type <tt>INVALID_FILE_PATH_FORMAT</tt>
will be generated. If a request is made for a file which does not
exist, or which is not currently subject to analysis (e.g. because it
is not associated with any analysis root specified to
analysis.setAnalysisRoots), an error of type
<tt>FILE_NOT_ANALYZED</tt> will be generated.
</p>
</field>
<field name="inTestMode" optional="true">
<ref>bool</ref>
<p>
A flag indicating whether the bulk fixes are being run in test mode.
The only difference is that in test mode the fix processor will look
for a configuration file that can modify the content of the data file
used to compute the fixes when data-driven fixes are being considered.
</p>
<p>
If this field is omitted the flag defaults to <tt>false</tt>.
</p>
</field>
</params>
<result>
<field name="edits">
<list>
<ref>SourceFileEdit</ref>
</list>
<p>
A list of source edits to apply the recommended changes.
</p>
</field>
<field name="details">
<list>
<ref>BulkFix</ref>
</list>
<p>
Details that summarize the fixes associated with the recommended
changes.
</p>
</field>
</result>
</request>
<request method="getFixes">
<p>
Return the set of fixes that are available for the errors at
a given offset in a given file.
</p>
<p>
If a request is made for a file which does not exist, or
which is not currently subject to analysis (e.g. because it
is not associated with any analysis root specified to
analysis.setAnalysisRoots), an error of type
<tt>GET_FIXES_INVALID_FILE</tt> will be generated.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file containing the errors for which fixes are being
requested.
</p>
</field>
<field name="offset">
<ref>int</ref>
<p>
The offset used to select the errors for which fixes
will be returned.
</p>
</field>
</params>
<result>
<field name="fixes">
<list>
<ref>AnalysisErrorFixes</ref>
</list>
<p>
The fixes that are available for the errors at the given offset.
</p>
</field>
</result>
</request>
<request method="getPostfixCompletion">
<p>
Get the changes required to convert the postfix template at the given
location into the template's expanded form.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file containing the postfix template to be expanded.
</p>
</field>
<field name="key">
<ref>String</ref>
<p>
The unique name that identifies the template in use.
</p>
</field>
<field name="offset">
<ref>int</ref>
<p>
The offset used to identify the code to which the template will be
applied.
</p>
</field>
</params>
<result>
<field name="change">
<ref>SourceChange</ref>
<p>
The change to be applied in order to complete the statement.
</p>
</field>
</result>
</request>
<request method="getRefactoring">
<p>
Get the changes required to perform a refactoring.
</p>
<p>
If another refactoring request is received during the processing
of this one, an error of type <tt>REFACTORING_REQUEST_CANCELLED</tt>
will be generated.
</p>
<params>
<field name="kind">
<ref>RefactoringKind</ref>
<p>
The kind of refactoring to be performed.
</p>
</field>
<field name="file">
<ref>FilePath</ref>
<p>
The file containing the code involved in the
refactoring.
</p>
</field>
<field name="offset">
<ref>int</ref>
<p>
The offset of the region involved in the refactoring.
</p>
</field>
<field name="length">
<ref>int</ref>
<p>
The length of the region involved in the refactoring.
</p>
</field>
<field name="validateOnly">
<ref>bool</ref>
<p>
True if the client is only requesting that the values of
the options be validated and no change be generated.
</p>
</field>
<field name="options" optional="true">
<ref>RefactoringOptions</ref>
<p>
Data used to provide values provided by the user. The
structure of the data is dependent on the kind of
refactoring being performed. The data that is expected is
documented in the section titled <a
href="#refactorings">Refactorings</a>, labeled as
"Options". This field can be omitted if the refactoring
does not require any options or if the values of those
options are not known.
</p>
</field>
</params>
<result>
<field name="initialProblems">
<list>
<ref>RefactoringProblem</ref>
</list>
<p>
The initial status of the refactoring, i.e. problems related to
the context in which the refactoring is requested.
The array will be empty if there are no known problems.
</p>
</field>
<field name="optionsProblems">
<list>
<ref>RefactoringProblem</ref>
</list>
<p>
The options validation status, i.e. problems in the given options,
such as light-weight validation of a new name, flags
compatibility, etc.
The array will be empty if there are no known problems.
</p>
</field>
<field name="finalProblems">
<list>
<ref>RefactoringProblem</ref>
</list>
<p>
The final status of the refactoring, i.e. problems identified in
the result of a full, potentially expensive validation and / or
change creation.
The array will be empty if there are no known problems.
</p>
</field>
<field name="feedback" optional="true">
<ref>RefactoringFeedback</ref>
<p>
Data used to provide feedback to the user. The structure
of the data is dependent on the kind of refactoring
being created. The data that is returned is documented
in the section titled <a
href="#refactorings">Refactorings</a>, labeled as
"Feedback".
</p>
</field>
<field name="change" optional="true">
<ref>SourceChange</ref>
<p>
The changes that are to be applied to affect the
refactoring. This field will be omitted if there are
problems that prevent a set of changes from being
computed, such as having no options specified for a
refactoring that requires them, or if only validation
was requested.
</p>
</field>
<field name="potentialEdits" optional="true">
<list>
<ref>String</ref>
</list>
<p>
The ids of source edits that are not known to be valid. An edit is
not known to be valid if there was insufficient type information
for the server to be able to determine whether or not the code
needs to be modified, such as when a member is being renamed and
there is a reference to a member from an unknown type. This field
will be omitted if the change field is omitted or if there are no
potential edits for the refactoring.
</p>
</field>
</result>
</request>
<request method="getStatementCompletion" experimental="true">
<p>
Get the changes required to convert the partial statement at the given
location into a syntactically valid statement. If the current statement
is already valid the change will insert a newline plus appropriate
indentation at the end of the line containing the offset.
If a change that makes the statement valid cannot be determined (perhaps
because it has not yet been implemented) the statement will be considered
already valid and the appropriate change returned.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file containing the statement to be completed.
</p>
</field>
<field name="offset">
<ref>int</ref>
<p>
The offset used to identify the statement to be completed.
</p>
</field>
</params>
<result>
<field name="change">
<ref>SourceChange</ref>
<p>
The change to be applied in order to complete the statement.
</p>
</field>
<field name="whitespaceOnly">
<ref>bool</ref>
<p>
Will be true if the change contains nothing but whitespace
characters, or is empty.
</p>
</field>
</result>
</request>
<request method="isPostfixCompletionApplicable" experimental="true">
<p>
Determine if the request postfix completion template is applicable at
the given location in the given file.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file containing the postfix template to be expanded.
</p>
</field>
<field name="key">
<ref>String</ref>
<p>
The unique name that identifies the template in use.
</p>
</field>
<field name="offset">
<ref>int</ref>
<p>
The offset used to identify the code to which the template will be
applied.
</p>
</field>
</params>
<result>
<field name="value">
<ref>bool</ref>
<p>
True if the template can be expanded at the given location.
</p>
</field>
</result>
</request>
<request method="listPostfixCompletionTemplates" experimental="true">
<p>
Return a list of all postfix templates currently available.
</p>
<result>
<field name="templates">
<list>
<ref>PostfixTemplateDescriptor</ref>
</list>
<p>
The list of available templates.
</p>
</field>
</result>
</request>
<request method="importElements" experimental="true">
<p>
Return a list of edits that would need to be applied in order to ensure
that all of the elements in the specified list of imported elements are
accessible within the library.
</p>
<p>
If a request is made for a file that does not exist, or that is not
currently subject to analysis (e.g. because it is not associated with any
analysis root specified via analysis.setAnalysisRoots), an error of type
<tt>IMPORT_ELEMENTS_INVALID_FILE</tt> will be generated.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file in which the specified elements are to be made accessible.
</p>
</field>
<field name="elements">
<list>
<ref>ImportedElements</ref>
</list>
<p>
The elements to be made accessible in the specified file.
</p>
</field>
<field name="offset" optional="true">
<ref>int</ref>
<p>
The offset at which the specified elements need to be made accessible.
If provided, this is used to guard against adding imports for text
that would be inserted into a comment, string literal, or other
location where the imports would not be necessary.
</p>
</field>
</params>
<result>
<field name="edit" optional="true">
<ref>SourceFileEdit</ref>
<p>
The edits to be applied in order to make the specified elements
accessible. The file to be edited will be the defining compilation
unit of the library containing the file specified in the request,
which can be different than the file specified in the request if the
specified file is a part file. This field will be omitted if there are
no edits that need to be applied.
</p>
</field>
</result>
</request>
<request method="sortMembers">
<p>
Sort all of the directives, unit and class members
of the given Dart file.
</p>
<p>
If a request is made for a file that does not exist, does not belong
to an analysis root or is not a Dart file,
<tt>SORT_MEMBERS_INVALID_FILE</tt> will be generated.
</p>
<p>
If the Dart file has scan or parse errors,
<tt>SORT_MEMBERS_PARSE_ERRORS</tt> will be generated.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The Dart file to sort.
</p>
</field>
</params>
<result>
<field name="edit">
<ref>SourceFileEdit</ref>
<p>
The file edit that is to be applied to the given file to effect
the sorting.
</p>
</field>
</result>
</request>
<request method="organizeDirectives">
<p>
Organizes all of the directives - removes unused imports and sorts
directives of the given Dart file according to the
<a href="https://dart.dev/guides/language/effective-dart/style">Dart Style
Guide</a>.
</p>
<p>
If a request is made for a file that does not exist, does not belong
to an analysis root or is not a Dart file,
<tt>FILE_NOT_ANALYZED</tt> will be generated.
</p>
<p>
If directives of the Dart file cannot be organized, for example
because it has scan or parse errors, or by other reasons,
<tt>ORGANIZE_DIRECTIVES_ERROR</tt> will be generated. The message
will provide details about the reason.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The Dart file to organize directives in.
</p>
</field>
</params>
<result>
<field name="edit">
<ref>SourceFileEdit</ref>
<p>
The file edit that is to be applied to the given file to effect
the organizing.
</p>
</field>
</result>
</request>
</domain>
<domain name="execution">
<p>
The execution domain contains commands related to providing an execution
or debugging experience.
</p>
<request method="createContext">
<p>
Create an execution context for the executable file with the given
path. The context that is created will persist until
execution.deleteContext is used to delete it. Clients, therefore, are
responsible for managing the lifetime of execution contexts.
</p>
<params>
<field name="contextRoot">
<ref>FilePath</ref>
<p>
The path of the Dart or HTML file that will be launched, or the
path of the directory containing the file.
</p>
</field>
</params>
<result>
<field name="id">
<ref>ExecutionContextId</ref>
<p>
The identifier used to refer to the execution context that was
created.
</p>
</field>
</result>
</request>
<request method="deleteContext">
<p>
Delete the execution context with the given identifier. The context id
is no longer valid after this command. The server is allowed to re-use
ids when they are no longer valid.
</p>
<params>
<field name="id">
<ref>ExecutionContextId</ref>
<p>
The identifier of the execution context that is to be deleted.
</p>
</field>
</params>
</request>
<request method="getSuggestions">
<p>
Request completion suggestions for the given runtime context.
</p>
<p>
It might take one or two requests of this type to get completion
suggestions. The first request should have only "code", "offset",
and "variables", but not "expressions". If there are sub-expressions that
can have different runtime types, and are considered to be safe to
evaluate at runtime (e.g. getters), so using their actual runtime types
can improve completion results, the server will not include the
"suggestions" field in the response, and instead will return the
"expressions" field. The client will use debug API to get current runtime
types for these sub-expressions and send another request, this time with
"expressions". If there are no interesting sub-expressions to get
runtime types for, or when the "expressions" field is provided by the
client, the server will return "suggestions" in the response.
</p>
<params>
<field name="code">
<ref>String</ref>
<p>
The code to get suggestions in.
</p>
</field>
<field name="offset">
<ref>int</ref>
<p>
The offset within the code to get suggestions at.
</p>
</field>
<field name="contextFile">
<ref>FilePath</ref>
<p>
The path of the context file, e.g. the file of the current debugger
frame. The combination of the context file and context offset can
be used to ensure that all variables of the context are available
for completion (with their static types).
</p>
</field>
<field name="contextOffset">
<ref>int</ref>
<p>
The offset in the context file, e.g. the line offset in the current
debugger frame.
</p>
</field>
<field name="variables">
<list>
<ref>RuntimeCompletionVariable</ref>
</list>
<p>
The runtime context variables that are potentially referenced in the
code.
</p>
</field>
<field name="expressions" optional="true">
<list>
<ref>RuntimeCompletionExpression</ref>
</list>
<p>
The list of sub-expressions in the code for which the client wants
to provide runtime types. It does not have to be the full list of
expressions requested by the server, for missing expressions their
static types will be used.
</p>
<p>
When this field is omitted, the server will return completion
suggestions only when there are no interesting sub-expressions in the
given code. The client may provide an empty list, in this case the
server will return completion suggestions.
</p>
</field>
</params>
<result>
<field name="suggestions" optional="true">
<list>
<ref>CompletionSuggestion</ref>
</list>
<p>
The completion suggestions. In contrast to usual completion request,
suggestions for private elements also will be provided.
</p>
<p>
If there are sub-expressions that can have different runtime types,
and are considered to be safe to evaluate at runtime (e.g. getters),
so using their actual runtime types can improve completion results,
the server omits this field in the response, and instead will return
the "expressions" field.
</p>
</field>
<field name="expressions" optional="true">
<list>
<ref>RuntimeCompletionExpression</ref>
</list>
<p>
The list of sub-expressions in the code for which the server would
like to know runtime types to provide better completion suggestions.
</p>
<p>
This field is omitted the field "suggestions" is returned.
</p>
</field>
</result>
</request>
<request method="mapUri">
<p>
Map a URI from the execution context to the file that it corresponds
to, or map a file to the URI that it corresponds to in the execution
context.
</p>
<p>
Exactly one of the file and uri fields must be provided. If both
fields are provided, then an error of type <tt>INVALID_PARAMETER</tt>
will be generated. Similarly, if neither field is provided, then an
error of type <tt>INVALID_PARAMETER</tt> will be generated.
</p>
<p>
If the file field is provided and the value is not the path of a file
(either the file does not exist or the path references something other
than a file), then an error of type <tt>INVALID_PARAMETER</tt> will
be generated.
</p>
<p>
If the uri field is provided and the value is not a valid URI or if
the URI references something that is not a file (either a file that
does not exist or something other than a file), then an error of type
<tt>INVALID_PARAMETER</tt> will be generated.
</p>
<p>
If the contextRoot used to create the execution context does not
exist, then an error of type <tt>INVALID_EXECUTION_CONTEXT</tt> will
be generated.
</p>
<params>
<field name="id">
<ref>ExecutionContextId</ref>
<p>
The identifier of the execution context in which the URI is to be
mapped.
</p>
</field>
<field name="file" optional="true">
<ref>FilePath</ref>
<p>
The path of the file to be mapped into a URI.
</p>
</field>
<field name="uri" optional="true">
<ref>String</ref>
<p>
The URI to be mapped into a file path.
</p>
</field>
</params>
<result>
<field name="file" optional="true">
<ref>FilePath</ref>
<p>
The file to which the URI was mapped. This field is omitted if the
uri field was not given in the request.
</p>
</field>
<field name="uri" optional="true">
<ref>String</ref>
<p>
The URI to which the file path was mapped. This field is omitted
if the file field was not given in the request.
</p>
</field>
</result>
</request>
<request method="setSubscriptions" deprecated="true">
<p>
<b>Deprecated:</b> the analysis server no longer fires
<tt>LAUNCH_DATA</tt> events.
</p>
<p>
Subscribe for services. All previous subscriptions are replaced by the
given set of services.
</p>
<p>
It is an error if any of the elements in the list are not valid
services. If there is an error, then the current subscriptions will
remain unchanged.
</p>
<params>
<field name="subscriptions">
<list>
<ref>ExecutionService</ref>
</list>
<p>
A list of the services being subscribed to.
</p>
</field>
</params>
</request>
<notification event="launchData">
<p>
Reports information needed to allow a single file to be launched.
</p>
<p>
This notification is not subscribed to by default. Clients can
subscribe by including the value "LAUNCH_DATA" in the list of services
passed in an <tt>execution.setSubscriptions</tt> request.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file for which launch data is being provided. This will either
be a Dart library or an HTML file.
</p>
</field>
<field name="kind" optional="true">
<ref>ExecutableKind</ref>
<p>
The kind of the executable file. This field is omitted if the file
is not a Dart file.
</p>
</field>
<field name="referencedFiles" optional="true">
<list>
<ref>FilePath</ref>
</list>
<p>
A list of the Dart files that are referenced by the file. This
field is omitted if the file is not an HTML file.
</p>
</field>
</params>
</notification>
</domain>
<domain name="diagnostic">
<p>
The diagnostic domain contains server diagnostics APIs.
</p>
<request method="getDiagnostics">
<p>Return server diagnostics.</p>
<result>
<field name="contexts">
<list>
<ref>ContextData</ref>
</list>
<p>The list of analysis contexts.</p>
</field>
</result>
</request>
<request method="getServerPort">
<p>
Return the port of the diagnostic web server. If the server is not running
this call will start the server. If unable to start the diagnostic web
server,
this call will return an error of <tt>DEBUG_PORT_COULD_NOT_BE_OPENED</tt>.
</p>
<result>
<field name="port">
<ref>int</ref>
<p>The diagnostic server port.</p>
</field>
</result>
</request>
</domain>
<domain name="analytics" experimental="true">
<p>
The analytics domain contains APIs related to reporting analytics.
</p>
<p>
This API allows clients to expose a UI option to enable and disable the
analysis server's reporting of analytics. This value is shared with other
tools and can change outside of this API; because of this, clients should
use the analysis server's flag as the system of record. Clients can choose
to send in additional analytics (see <tt>sendEvent</tt> and
<tt>sendTiming</tt>) if they so choose. Dart command-line tools provide a
disclaimer similar to:
<tt>
Dart SDK tools anonymously report feature usage statistics and basic crash
reports to help improve Dart tools over time. See Google's privacy policy:
https://www.google.com/intl/en/policies/privacy/.
</tt>
</p>
<p>
The analysis server will send it's own analytics data (for example,
operations performed, operating system type, SDK version). No data (from the
analysis server or from clients) will be sent if analytics is disabled.
</p>
<request method="isEnabled">
<p>Query whether analytics is enabled.</p>
<p>
This flag controls whether the analysis server sends any analytics data to
the cloud. If disabled, the analysis server does not send any analytics
data, and any data sent to it by clients (from <tt>sendEvent</tt> and
<tt>sendTiming</tt>) will be ignored.
</p>
<p>
The value of this flag can be changed by other tools outside of the
analysis server's process. When you query the flag, you get the value of
the flag at a given moment. Clients should not use the value returned to
decide whether or not to send the <tt>sendEvent</tt> and
<tt>sendTiming</tt> requests. Those requests should be used
unconditionally and server will determine whether or not it is appropriate
to forward the information to the cloud at the time each request is
received.
</p>
<result>
<field name="enabled">
<ref>bool</ref>
<p>Whether sending analytics is enabled or not.</p>
</field>
</result>
</request>
<request method="enable">
<p>
Enable or disable the sending of analytics data. Note that there are other
ways for users to change this setting, so clients cannot assume that they
have complete control over this setting. In particular, there is no
guarantee that the result returned by the <tt>isEnabled</tt> request will
match the last value set via this request.
</p>
<params>
<field name="value">
<ref>bool</ref>
<p>Enable or disable analytics.</p>
</field>
</params>
</request>
<request method="sendEvent">
<p>Send information about client events.</p>
<p>
Ask the analysis server to include the fact that an action was performed
in the client as part of the analytics data being sent. The data will only
be included if the sending of analytics data is enabled at the time the
request is processed. The action that was performed is indicated by the
value of the <tt>action</tt> field.
</p>
<p>
The value of the action field should not include the identity of the
client. The analytics data sent by server will include the client id
passed in using the <tt>--client-id</tt> command-line argument. The
request will be ignored if the client id was not provided when server was
started.
</p>
<params>
<field name="action">
<ref>String</ref>
<p>The value used to indicate which action was performed.</p>
</field>
</params>
</request>
<request method="sendTiming">
<p>Send timing information for client events (e.g. code completions).</p>
<p>
Ask the analysis server to include the fact that a timed event occurred as
part of the analytics data being sent. The data will only be included if
the sending of analytics data is enabled at the time the request is
processed.
</p>
<p>
The value of the event field should not include the identity of the
client. The analytics data sent by server will include the client id
passed in using the <tt>--client-id</tt> command-line argument. The
request will be ignored if the client id was not provided when server was
started.
</p>
<params>
<field name="event">
<ref>String</ref>
<p>The name of the event.</p>
</field>
<field name="millis">
<ref>int</ref>
<p>The duration of the event in milliseconds.</p>
</field>
</params>
</request>
</domain>
<domain name="kythe" experimental="true">
<p>
The kythe domain contains APIs related to generating Dart content in the
<a href="http://kythe.io/">Kythe</a> format.
</p>
<request method="getKytheEntries">
<p>
Return the list of <tt>KytheEntry</tt> objects for some file, given the
current state of the file system populated by "analysis.updateContent".
</p>
<p>
If a request is made for a file that does not exist, or that is not
currently subject to analysis (e.g. because it is not associated with any
analysis root specified to analysis.setAnalysisRoots), an error of type
<tt>GET_KYTHE_ENTRIES_INVALID_FILE</tt> will be generated.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file containing the code for which the Kythe Entry objects are
being requested.
</p>
</field>
</params>
<result>
<field name="entries">
<list>
<ref>KytheEntry</ref>
</list>
<p>
The list of <tt>KytheEntry</tt> objects for the queried file.
</p>
</field>
<field name="files">
<list>
<ref>FilePath</ref>
</list>
<p>
The set of files paths that were required, but not in the file system,
to give a complete and accurate Kythe graph for the file. This could
be due to a referenced file that does not exist or generated files not
being generated or passed before the call to "getKytheEntries".
</p>
</field>
</result>
</request>
</domain>
<domain name="flutter">
<p>
The analysis domain contains API’s related to Flutter support.
</p>
<request method="getWidgetDescription" experimental="true">
<p>
Return the description of the widget instance at the given location.
</p>
<p>
If the location does not have a support widget, an error of type
<tt>FLUTTER_GET_WIDGET_DESCRIPTION_NO_WIDGET</tt> will be generated.
</p>
<p>
If a change to a file happens while widget descriptions are computed,
an error of type <tt>FLUTTER_GET_WIDGET_DESCRIPTION_CONTENT_MODIFIED</tt>
will be generated.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file where the widget instance is created.
</p>
</field>
<field name="offset">
<ref>int</ref>
<p>
The offset in the file where the widget instance is created.
</p>
</field>
</params>
<result>
<field name="properties">
<list>
<ref>FlutterWidgetProperty</ref>
</list>
<p>
The list of properties of the widget. Some of the properties might be
read only, when their <tt>editor</tt> is not set. This might be
because they have type that we don't know how to edit, or for
compound properties that work as containers for sub-properties.
</p>
</field>
</result>
</request>
<request method="setWidgetPropertyValue" experimental="true">
<p>
Set the value of a property, or remove it.
</p>
<p>
The server will generate a change that the client should apply to the
project to get the value of the property set to the new value.
The complexity of the change might be from updating a single literal
value in the code, to updating multiple files to get libraries imported,
and new intermediate widgets instantiated.
</p>
<params>
<field name="id">
<ref>int</ref>
<p>
The identifier of the property, previously returned as a part of
a <tt>FlutterWidgetProperty</tt>.
</p>
<p>
An error of type <tt>FLUTTER_SET_WIDGET_PROPERTY_VALUE_INVALID_ID</tt>
is generated if the identifier is not valid.
</p>
</field>
<field name="value" optional="true">
<ref>FlutterWidgetPropertyValue</ref>
<p>
The new value to set for the property.
</p>
<p>
If absent, indicates that the property should be removed. If the
property corresponds to an optional parameter, the corresponding
named argument is removed. If the property <tt>isRequired</tt> is
true, <tt>FLUTTER_SET_WIDGET_PROPERTY_VALUE_IS_REQUIRED</tt> error
is generated.
</p>
<p>
If the <tt>expression</tt> is not a syntactically valid Dart code,
then <tt>FLUTTER_SET_WIDGET_PROPERTY_VALUE_INVALID_EXPRESSION</tt>
is reported.
</p>
</field>
</params>
<result>
<field name="change">
<ref>SourceChange</ref>
<p>
The change that should be applied.
</p>
</field>
</result>
</request>
<request method="setSubscriptions">
<p>
Subscribe for services that are specific to individual files.
All previous subscriptions are replaced by the current set of
subscriptions. If a given service is not included as a key in the map
then no files will be subscribed to the service, exactly as if the
service had been included in the map with an explicit empty list of
files.
</p>
<p>
Note that this request determines the set of requested
subscriptions. The actual set of subscriptions at any given
time is the intersection of this set with the set of files
currently subject to analysis. The files currently subject
to analysis are the set of files contained within an actual
analysis root but not excluded, plus all of the files
transitively reachable from those files via import, export
and part directives. (See analysis.setAnalysisRoots for an
explanation of how the actual analysis roots are
determined.) When the actual analysis roots change, the
actual set of subscriptions is automatically updated, but
the set of requested subscriptions is unchanged.
</p>
<p>
If a requested subscription is a directory it is ignored,
but remains in the set of requested subscriptions so that if
it later becomes a file it can be included in the set of
actual subscriptions.
</p>
<p>
It is an error if any of the keys in the map are not valid
services. If there is an error, then the existing
subscriptions will remain unchanged.
</p>
<params>
<field name="subscriptions">
<map>
<key>
<ref>FlutterService</ref>
</key>
<value>
<list>
<ref>FilePath</ref>
</list>
</value>
</map>
<p>
A table mapping services to a list of the files being
subscribed to the service.
</p>
</field>
</params>
</request>
<notification event="outline">
<p>
Reports the Flutter outline associated with a single file.
</p>
<p>
This notification is not subscribed to by default. Clients
can subscribe by including the value <tt>"OUTLINE"</tt> in
the list of services passed in an flutter.setSubscriptions
request.
</p>
<params>
<field name="file">
<ref>FilePath</ref>
<p>
The file with which the outline is associated.
</p>
</field>
<field name="outline">
<ref>FlutterOutline</ref>
<p>
The outline associated with the file.
</p>
</field>
</params>
</notification>
</domain>
<types>
<h2 class="domain"><a name="types">Types</a></h2>
<p>
This section contains descriptions of the data types referenced
in the API’s of the various domains.
</p>
<include path="../../../analyzer_plugin/tool/spec/common_types_spec.html"
import="package:analyzer_plugin/protocol/protocol_common.dart"></include>
<type name="AnalysisErrorFixes">
<p>
A list of fixes associated with a specific error.
</p>
<object>
<field name="error">
<ref>AnalysisError</ref>
<p>
The error with which the fixes are associated.
</p>
</field>
<field name="fixes">
<list>
<ref>SourceChange</ref>
</list>
<p>
The fixes associated with the error.
</p>
</field>
</object>
</type>
<type name="AnalysisOptions" deprecated="true">
<p><b>Deprecated:</b> the only reference to this type has been
deprecated.</p>
<p>
A set of options controlling what kind of analysis is to be
performed. If the value of a field is omitted the value of the
option will not be changed.
</p>
<object>
<field name="enableAsync" optional="true" deprecated="true">
<ref>bool</ref>
<p><b>Deprecated:</b> this feature is always enabled.</p>
<p>
True if the client wants to enable support for the
proposed async feature.
</p>
</field>
<field name="enableDeferredLoading" optional="true" deprecated="true">
<ref>bool</ref>
<p><b>Deprecated:</b> this feature is always enabled.</p>
<p>
True if the client wants to enable support for the
proposed deferred loading feature.
</p>
</field>
<field name="enableEnums" optional="true" deprecated="true">
<ref>bool</ref>
<p><b>Deprecated:</b> this feature is always enabled.</p>
<p>
True if the client wants to enable support for the
proposed enum feature.
</p>
</field>
<field name="enableNullAwareOperators" optional="true" deprecated="true">
<ref>bool</ref>
<p><b>Deprecated:</b> this feature is always enabled.</p>
<p>
True if the client wants to enable support for the
proposed "null aware operators" feature.
</p>
</field>
<field name="enableSuperMixins" optional="true">
<ref>bool</ref>
<p>
True if the client wants to enable support for the
proposed "less restricted mixins" proposal (DEP 34).
</p>
</field>
<field name="generateDart2jsHints" optional="true">
<ref>bool</ref>
<p>
True if hints that are specific to dart2js should be
generated. This option is ignored if generateHints is false.
</p>
</field>
<field name="generateHints" optional="true">
<ref>bool</ref>
<p>
True if hints should be generated as part of generating
errors and warnings.
</p>
</field>
<field name="generateLints" optional="true">
<ref>bool</ref>
<p>
True if lints should be generated as part of generating
errors and warnings.
</p>
</field>
</object>
</type>
<type name="AnalysisService">
<p>
An enumeration of the services provided by the analysis domain that
are related to a specific list of files.
</p>
<enum>
<value><code>CLOSING_LABELS</code></value>
<value><code>FOLDING</code></value>
<value><code>HIGHLIGHTS</code></value>
<value><code>IMPLEMENTED</code></value>
<value>
<code>INVALIDATE</code>
<p>
This service is not currently implemented and will become a
GeneralAnalysisService in a future release.
</p>
</value>
<value><code>NAVIGATION</code></value>
<value><code>OCCURRENCES</code></value>
<value><code>OUTLINE</code></value>
<value><code>OVERRIDES</code></value>
</enum>
</type>
<type name="AnalysisStatus">
<p>
An indication of the current state of analysis.
</p>
<object>
<field name="isAnalyzing">
<ref>bool</ref>
<p>True if analysis is currently being performed.</p>
</field>
<field name="analysisTarget" optional="true">
<ref>String</ref>
<p>
The name of the current target of analysis. This field is
omitted if analyzing is false.
</p>
</field>
</object>
</type>
<type name="BulkFix">
<p>
A description of bulk fixes to a library.
</p>
<object>
<field name="path">
<ref>FilePath</ref>
<p>
The path of the library.
</p>
</field>
<field name="fixes">
<list>
<ref>BulkFixDetail</ref>
</list>
<p>
A list of bulk fix details.
</p>
</field>
</object>
</type>
<type name="BulkFixDetail">
<p>
A description of a fix applied to a library.
</p>
<object>
<field name="code">
<ref>String</ref>
<p>
The code of the diagnostic associated with the fix.
</p>
</field>
<field name="occurrences">
<ref>int</ref>
<p>
The number times the associated diagnostic was fixed in the associated
source edit.
</p>
</field>
</object>
</type>
<type name="ClosingLabel">
<p>
A label that is associated with a range of code that may be useful to
render at the end of the range to aid code readability. For example, a
constructor call that spans multiple lines may result in a closing label
to allow the constructor type/name to be rendered alongside the closing
parenthesis.
</p>
<object>
<field name="offset">
<ref>int</ref>
<p>
The offset of the construct being labelled.
</p>
</field>
<field name="length">
<ref>int</ref>
<p>
The length of the whole construct to be labelled.
</p>
</field>
<field name="label">
<ref>String</ref>
<p>
The label associated with this range that should be displayed to the
user.
</p>
</field>
</object>
</type>
<type name="CompletionId">
<ref>String</ref>
<p>
An identifier used to associate completion results with a
completion request.
</p>
</type>
<type name="ContextData">
<p>
Information about an analysis context.
</p>
<object>
<field name="name">
<ref>String</ref>
<p>
The name of the context.
</p>
</field>
<field name="explicitFileCount">
<ref>int</ref>
<p>
Explicitly analyzed files.
</p>
</field>
<field name="implicitFileCount">
<ref>int</ref>
<p>
Implicitly analyzed files.
</p>
</field>
<field name="workItemQueueLength">
<ref>int</ref>
<p>
The number of work items in the queue.
</p>
</field>
<field name="cacheEntryExceptions">
<list>
<ref>String</ref>
</list>
<p>
Exceptions associated with cache entries.
</p>
</field>
</object>
</type>
<type name="ElementDeclaration">
<p>
A declaration - top-level (class, field, etc) or a class member (method,
field, etc).
</p>
<object>
<field name="name">
<ref>String</ref>
<p>
The name of the declaration.
</p>
</field>
<field name="kind">
<ref>ElementKind</ref>
<p>
The kind of the element that corresponds to the declaration.
</p>
</field>
<field name="fileIndex">
<ref>int</ref>
<p>
The index of the file (in the enclosing response).
</p>
</field>
<field name="offset">
<ref>int</ref>
<p>
The offset of the declaration name in the file.
</p>
</field>
<field name="line">
<ref>int</ref>
<p>
The one-based index of the line containing the declaration name.
</p>
</field>
<field name="column">
<ref>int</ref>
<p>
The one-based index of the column containing the declaration name.
</p>
</field>
<field name="codeOffset">
<ref>int</ref>
<p>
The offset of the first character of the declaration code in the file.
</p>
</field>
<field name="codeLength">
<ref>int</ref>
<p>
The length of the declaration code in the file.
</p>
</field>
<field name="className" optional="true">
<ref>String</ref>
<p>
The name of the class enclosing this declaration. If the declaration
is not a class member, this field will be absent.
</p>
</field>
<field name="mixinName" optional="true">
<ref>String</ref>
<p>
The name of the mixin enclosing this declaration. If the declaration
is not a mixin member, this field will be absent.
</p>
</field>
<field name="parameters" optional="true">
<ref>String</ref>
<p>
The parameter list for the element. If the element is not a method or
function this field will not be defined. If the element doesn't have
parameters (e.g. getter), this field will not be defined. If the
element has zero parameters, this field will have a value of "()".
The value should not be treated as exact presentation of parameters,
it is just approximation of parameters to give the user general idea.
</p>
</field>
</object>
</type>
<type name="ExecutableFile">
<p>
A description of an executable file.