This document contains a specification of the API used by the analysis server to communicate with analysis server plugins. Changes to the API will be accompanied by an update to the protocol version number according to the principles of semantic versioning (semver.org).
TBD
The plugin domain contains API’s related to the execution of a plugin.
TODO: Provide notifications by which plugins can report instrumentation and/or DartSilo data.
TODO: Add a notification to the server protocol to inform the client of problems related to the execution of plugins.
request: { "id": String "method": "plugin.versionCheck" "params": { "byteStorePath": FilePath "sdkPath": FilePath "version": String } }
response: { "id": String "error": optional RequestError "result": { "isCompatible": bool "name": String "version": String "contactInfo": optional String "interestingFiles": List<String> } }
Used to request that the plugin perform a version check to confirm that it works with the version of the analysis server that is executing it.
The path to the directory containing the on-disk byte store that is to be used by any analysis drivers that are created.
The path to the directory containing the SDK that is to be used by any analysis drivers that are created.
The version number of the plugin spec supported by the analysis server that is executing the plugin.
A flag indicating whether the plugin supports the same version of the plugin spec as the analysis server. If the value is false, then the plugin is expected to shutdown after returning the response.
The name of the plugin. This value is only used when the server needs to identify the plugin, either to the user or for debugging purposes.
The version of the plugin. This value is only used when the server needs to identify the plugin, either to the user or for debugging purposes.
Information that the user can use to use to contact the maintainers of the plugin when there is a problem.
The glob patterns of the files for which the plugin will provide information. This value is ignored if the isCompatible field is false. Otherwise, it will be used to identify the files for which the plugin should be notified of changes.
request: { "id": String "method": "plugin.shutdown" }
response: { "id": String "error": optional RequestError }
Used to request that the plugin exit. The server will not send any other requests after this request. The plugin should not send any responses or notifications after sending the response to this request.
notification: { "event": "plugin.error" "params": { "isFatal": bool "message": String "stackTrace": String } }
Used to report that an unexpected error has occurred while executing the plugin. This notification is not used for problems with specific requests (which should be returned as part of the response) but is used for exceptions that occur while performing other tasks, such as analysis or preparing notifications.
A flag indicating whether the error is a fatal error, meaning that the plugin will shutdown automatically after sending this notification. If true, the server will not expect any other responses or notifications from the plugin.
The error message indicating what kind of error was encountered.
The stack trace associated with the generation of the error, used for debugging the plugin.
The analysis domain contains API’s related to the analysis of files.
request: { "id": String "method": "analysis.getNavigation" "params": { "file": FilePath "offset": int "length": int } }
response: { "id": String "error": optional RequestError "result": { "files": List<FilePath> "targets": List<NavigationTarget> "regions": List<NavigationRegion> } }
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 CONTENT_MODIFIED will be generated.
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.
The file in which navigation information is being requested.
The offset of the region for which navigation information is being requested.
The length of the region for which navigation information is being requested.
A list of the paths of files that are referenced by the navigation targets.
A list of the navigation targets that are referenced by the navigation regions.
A list of the navigation regions within the requested region of the file.
request: { "id": String "method": "analysis.handleWatchEvents" "params": { "events": List<WatchEvent> } }
response: { "id": String "error": optional RequestError }
Used to inform the plugin of changes to files in the file system. Only events associated with files that match the interestingFiles glob patterns will be forwarded to the plugin.
The watch events that the plugin should handle.
request: { "id": String "method": "analysis.setContextRoots" "params": { "roots": List<ContextRoot> } }
response: { "id": String "error": optional RequestError }
Set the list of context roots that should be analyzed.
A list of the context roots that should be analyzed.
request: { "id": String "method": "analysis.setPriorityFiles" "params": { "files": List<FilePath> } }
response: { "id": String "error": optional RequestError }
Used to set the priority files to the files in the given list. A priority file is a file that should be 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.
The files that are to be a priority for analysis.
request: { "id": String "method": "analysis.setSubscriptions" "params": { "subscriptions": Map<AnalysisService, List<FilePath>> } }
response: { "id": String "error": optional RequestError }
Used to subscribe for services that are specific to individual files. All previous subscriptions should be replaced by the current set of subscriptions. If a given service is not included as a key in the map then no files should be subscribed to the service, exactly as if the service had been included in the map with an explicit empty list of files.
A table mapping services to a list of the files being subscribed to the service.
request: { "id": String "method": "analysis.updateContent" "params": { "files": Map<FilePath, AddContentOverlay | ChangeContentOverlay | RemoveContentOverlay> } }
response: { "id": String "error": optional RequestError }
Used to 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 the plugin 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.
A table mapping the files whose content has changed to a description of the content change.
notification: { "event": "analysis.errors" "params": { "file": FilePath "errors": List<AnalysisError> } }
Used to report 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.
The file containing the errors.
The errors contained in the file.
notification: { "event": "analysis.folding" "params": { "file": FilePath "regions": List<FoldingRegion> } }
Used to report the folding regions associated with a given file. Folding regions can be nested, but cannot be overlapping. Nesting occurs when a foldable element, such as a method, is nested inside another foldable element such as a class.
Folding regions that overlap a folding region computed by the server, or by one of the other plugins that are currently running, might be dropped by the server in order to present a consistent view to the client.
This notification should only be sent if the server has subscribed to it by including the value "FOLDING" in the list of services passed in an analysis.setSubscriptions request.
The file containing the folding regions.
The folding regions contained in the file.
notification: { "event": "analysis.highlights" "params": { "file": FilePath "regions": List<HighlightRegion> } }
Used to report the highlight regions associated with a given 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.
This notification should only be sent if the server has subscribed to it by including the value "HIGHLIGHTS" in the list of services passed in an analysis.setSubscriptions request.
The file containing the highlight regions.
The highlight regions contained in the file.
notification: { "event": "analysis.navigation" "params": { "file": FilePath "regions": List<NavigationRegion> "targets": List<NavigationTarget> "files": List<FilePath> } }
Used to report the navigation regions associated with a given file. 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 should not overlap other navigation regions.
Navigation regions that overlap a navigation region computed by the server, or by one of the other plugins that are currently running, might be dropped or modified by the server in order to present a consistent view to the client.
This notification should only be sent if the server has subscribed to it by including the value "NAVIGATION" in the list of services passed in an analysis.setSubscriptions request.
The file containing the navigation regions.
The navigation regions contained in the file.
The navigation targets referenced in the file. They are referenced by NavigationRegions by their index in this array.
The files containing navigation targets referenced in the file. They are referenced by NavigationTargets by their index in this array.
notification: { "event": "analysis.occurrences" "params": { "file": FilePath "occurrences": List<Occurrences> } }
Used to report the occurrences of references to elements within a single file. None of the occurrence regions should overlap.
Occurrence regions that overlap an occurrence region computed by the server, or by one of the other plugins that are currently running, might be dropped or modified by the server in order to present a consistent view to the client.
This notification should only be sent if the server has subscribed to it by including the value "OCCURRENCES" in the list of services passed in an analysis.setSubscriptions request.
The file in which the references occur.
The occurrences of references to elements within the file.
notification: { "event": "analysis.outline" "params": { "file": FilePath "outline": List<Outline> } }
Used to report the outline fragments associated with a single file.
The outline fragments will be merged with any outline produced by the server and with any fragments produced by other plugins. If the server cannot create a coherent outline, some fragments might be dropped.
This notification should only be sent if the server has subscribed to it by including the value "OUTLINE" in the list of services passed in an analysis.setSubscriptions request.
The file with which the outline is associated.
The outline fragments associated with the file.
The code completion domain contains API's related to getting code completion suggestions.
request: { "id": String "method": "completion.getSuggestions" "params": { "file": FilePath "offset": int } }
response: { "id": String "error": optional RequestError "result": { "replacementOffset": int "replacementLength": int "results": List<CompletionSuggestion> } }
Used to request that completion suggestions for the given offset in the given file be returned.
The file containing the point at which suggestions are to be made.
The offset within the file at which suggestions are to be made.
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.
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).
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.
The edit domain contains API's related to edits that can be applied to the code.
request: { "id": String "method": "edit.getAssists" "params": { "file": FilePath "offset": int "length": int } }
response: { "id": String "error": optional RequestError "result": { "assists": List<PrioritizedSourceChange> } }
Used to request 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.
The file containing the code for which assists are being requested.
The offset of the code for which assists are being requested.
The length of the code for which assists are being requested.
The assists that are available at the given location.
request: { "id": String "method": "edit.getFixes" "params": { "file": FilePath "offset": int } }
response: { "id": String "error": optional RequestError "result": { "fixes": List<AnalysisErrorFixes> } }
Used to request the set of fixes that are available for the errors at a given offset in a given file.
The file containing the errors for which fixes are being requested.
The offset used to select the errors for which fixes will be returned.
The fixes that are available for the errors at the given offset.
This section contains descriptions of the data types referenced in the API’s of the various domains.
A directive to begin overlaying the contents of a file. The supplied content will be used for analysis in place of the file contents in the filesystem.
If this directive is used on a file that already has a file content overlay, the old overlay is discarded and replaced with the new one.
The new content of the file.
An indication of an error, warning, or hint that was produced by the analysis.
The severity of the error.
The type of the error.
The location associated with the error.
The message to be displayed for this error. The message should indicate what is wrong with the code and why it is wrong.
The correction message to be displayed for this error. The correction message should indicate how the user can fix the error. The field is omitted if there is no correction message associated with the error code.
The name, as a string, of the error code associated with this error.
The URL of a page containing documentation associated with this error.
Additional messages associated with this diagnostic that provide context to help the user understand the diagnostic.
A hint to indicate to interested clients that this error has an associated fix (or fixes). The absence of this field implies there are not known to be fixes. Note that since the operation to calculate whether fixes apply needs to be performant it is possible that complicated tests will be skipped and a false negative returned. For this reason, this attribute should be treated as a "hint". Despite the possibility of false negatives, no false positives should be returned. If a client sees this flag set they can proceed with the confidence that there are in fact associated fixes.
A list of fixes associated with a specific error
The error with which the fixes are associated.
The fixes associated with the error.
An enumeration of the possible severities of analysis errors.
An enumeration of the possible types of analysis errors.
An enumeration of the services provided by the analysis domain that are related to a specific list of files.
A directive to modify an existing file content overlay. One or more ranges of text are deleted from the old file content overlay and replaced with new text.
The edits are applied in the order in which they occur in the list. This means that the offset of each edit must be correct under the assumption that all previous edits have been applied.
It is an error to use this overlay on a file that does not yet have a file content overlay or that has had its overlay removed via RemoveContentOverlay.
If any of the edits cannot be applied due to its offset or length being out of range, an INVALID_OVERLAY_CHANGE error will be reported.
The edits to be applied to the file.
A suggestion for how to complete partially entered text. Many of the fields are optional, depending on the kind of element being suggested.
The kind of element being suggested.
The relevance of this completion suggestion where a higher number indicates a higher relevance.
The identifier to be inserted if the suggestion is selected. If the suggestion is for a method or function, the client might want to additionally insert a template for the parameters. The information required in order to do so is contained in other fields.
Text to be displayed in, for example, a completion pop-up. This field is only defined if the displayed text should be different than the completion. Otherwise it is omitted.
The offset, relative to the beginning of the completion, of where the selection should be placed after insertion.
The number of characters that should be selected after insertion.
True if the suggested element is deprecated.
True if the element is not known to be valid for the target. This happens if the type of the target is dynamic.
An abbreviated version of the Dartdoc associated with the element being suggested. This field is omitted if there is no Dartdoc associated with the element.
The Dartdoc associated with the element being suggested. This field is omitted if there is no Dartdoc associated with the element.
The class that declares the element being suggested. This field is omitted if the suggested element is not a member of a class.
A default String for use in generating argument list source contents on the client side.
Pairs of offsets and lengths describing 'defaultArgumentListString' text ranges suitable for use by clients to set up linked edits of default argument source contents. For example, given an argument list string 'x, y', the corresponding text range [0, 1, 3, 1], indicates two text ranges of length 1, starting at offsets 0 and 3. Clients can use these ranges to treat the 'x' and 'y' values specially for linked edits.
Information about the element reference being suggested.
The return type of the getter, function or method or the type of the field being suggested. This field is omitted if the suggested element is not a getter, function or method.
The names of the parameters of the function or method being suggested. This field is omitted if the suggested element is not a setter, function or method.
The types of the parameters of the function or method being suggested. This field is omitted if the parameterNames field is omitted.
The number of required parameters for the function or method being suggested. This field is omitted if the parameterNames field is omitted.
True if the function or method being suggested has at least one named parameter. This field is omitted if the parameterNames field is omitted.
The name of the optional parameter being suggested. This field is omitted if the suggestion is not the addition of an optional argument within an argument list.
The type of the options parameter being suggested. This field is omitted if the parameterName field is omitted.
An enumeration of the kinds of elements that can be included in a completion suggestion.
A list of arguments for the method or function that is being invoked. For this suggestion kind, the completion field is a textual representation of the invocation and the parameterNames, parameterTypes, and requiredParameterCount attributes are defined.
The element identifier should be inserted at the completion location. For example "someMethod" in import 'myLib.dart' show someMethod;. For suggestions of this kind, the element attribute is defined and the completion field is the element's identifier.
The element is being invoked at the completion location. For example, 'someMethod' in x.someMethod();. For suggestions of this kind, the element attribute is defined and the completion field is the element's identifier.
A keyword is being suggested. For suggestions of this kind, the completion is the keyword.
A named argument for the current call site is being suggested. For suggestions of this kind, the completion is the named argument identifier including a trailing ':' and a space.
An overriding implementation of a class member is being suggested.
A description of an analysis context.
The absolute path of the root directory containing the files to be analyzed.
A list of the absolute paths of files and directories within the root directory that should not be analyzed.
The absolute path of the analysis options file that should be used to control the analysis of the files in the context.
A message associated with a diagnostic.
For example, if the diagnostic is reporting that a variable has been referenced before it was declared, it might have a diagnostic message that indicates where the variable is declared.
The message to be displayed to the user.
The location associated with or referenced by the message. Clients should provide the ability to navigate to the location.
Information about an element (something that can be declared in code).
The kind of the element.
The name of the element. This is typically used as the label in the outline.
The location of the name in the declaration of the element.
A bit-map containing the following flags:
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 return type of the element. If the element is not a method or function this field will not be defined. If the element does not have a declared return type, this field will contain an empty string.
The type parameter list for the element. If the element doesn't have type parameters, this field will not be defined.
An enumeration of the kinds of elements.
The absolute, normalized path of a file.
If the format of a file path in a request is not valid, e.g. the path is not absolute or is not normalized, then an error of type INVALID_FILE_PATH_FORMAT will be generated.
An enumeration of the kinds of folding regions.
A description of a region that can be folded.
The kind of the region.
The offset of the region to be folded.
The length of the region to be folded.
A description of a region that could have special highlighting associated with it.
The type of highlight associated with the region.
The offset of the region to be highlighted.
The length of the region to be highlighted.
An enumeration of the kinds of highlighting that can be applied to files.
Only for version 1 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
Only for version 1 of highlight.
Only for version 1 of highlight.
Only for version 1 of highlight.
Only for version 1 of highlight.
Only for version 1 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
Only for version 1 of highlight.
Only for version 2 of highlight.
Only for version 1 of highlight.
Only for version 1 of highlight.
Only for version 1 of highlight.
Only for version 1 of highlight.
Only for version 1 of highlight.
Only for version 1 of highlight.
Only for version 1 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
Only for version 2 of highlight.
This object matches the format and documentation of the Entry object documented in the Kythe Storage Model.
The ticket of the source node.
An edge label. The schema defines which labels are meaningful.
The ticket of the target node.
A fact label. The schema defines which fact labels are meaningful.
The String value of the fact.
This object matches the format and documentation of the Vector-Name object documented in the Kythe Storage Model.
An opaque signature generated by the analyzer.
The corpus of source code this KytheVName belongs to. Loosely, a corpus is a collection of related files, such as the contents of a given source repository.
A corpus-specific root label, typically a directory path or project identifier, denoting a distinct subset of the corpus. This may also be used to designate virtual collections like generated files.
A path-structured label describing the “location” of the named object relative to the corpus and the root.
The language this name belongs to.
A collection of positions that should be linked (edited simultaneously) for the purposes of updating code after a source change. For example, if a set of edits introduced a new variable name, the group would contain all of the positions of the variable name so that if the client wanted to let the user edit the variable name after the operation, all occurrences of the name could be edited simultaneously.
The positions of the regions that should be edited simultaneously.
The length of the regions that should be edited simultaneously.
Pre-computed suggestions for what every region might want to be changed to.
A suggestion of a value that could be used to replace all of the linked edit regions in a LinkedEditGroup.
The value that could be used to replace all of the linked edit regions.
The kind of value being proposed.
An enumeration of the kind of values that can be suggested for a linked edit.
A location (character range) within a file.
The file containing the range.
The offset of the range.
The length of the range.
The one-based index of the line containing the first character of the range.
The one-based index of the column containing the first character of the range.
A description of a region from which the user can navigate to the declaration of an element.
The offset of the region from which the user can navigate.
The length of the region from which the user can navigate.
The indexes of the targets (in the enclosing navigation response) to which the given region is bound. By opening the target, clients can implement one form of navigation. This list cannot be empty.
A description of a target to which the user can navigate.
The kind of the element.
The index of the file (in the enclosing navigation response) to navigate to.
The offset of the region to which the user can navigate.
The length of the region to which the user can navigate.
The one-based index of the line containing the first character of the region.
The one-based index of the column containing the first character of the region.
A description of the references to a single element within a single file.
The element that was referenced.
The offsets of the name of the referenced element within the file.
The length of the name of the referenced element.
An node in the outline structure of a file.
A description of the element represented by this node.
The offset of the first character of the element. This is different than the offset in the Element, which is the offset of the name of the element. It can be used, for example, to map locations in the file back to an outline.
The length of the element.
The offset of the first character of the element code, which is neither documentation, nor annotation.
The length of the element code.
The children of the node. The field will be omitted if the node has no children. Children are sorted by offset.
A position within a file.
The file containing the position.
The offset of the position.
A source change that has a priority associated with it.
The priority of the change. The value is expected to be non-negative, and zero (0) is the lowest priority.
The change with which the relevance is associated.
An enumeration of the kinds of refactorings that can be created.
A description of a parameter in a method refactoring.
The unique identifier of the parameter. Clients may omit this field for the parameters they want to add.
The kind of the parameter.
The type that should be given to the parameter, or the return type of the parameter's function type.
The name that should be given to the parameter.
The parameter list of the parameter's function type. If the parameter is not of a function type, this field will not be defined. If the function type has zero parameters, this field will have a value of '()'.
An enumeration of the kinds of parameters.
A description of a problem related to a refactoring.
The severity of the problem being represented.
A human-readable description of the problem being represented.
The location of the problem being represented. This field is omitted unless there is a specific location associated with the problem (such as a location where an element being renamed will be shadowed).
An enumeration of the severities of problems that can be returned by the refactoring requests.
A minor code problem. No example, because it is not used yet.
A minor code problem. For example names of local variables should be camel case and start with a lower case letter. Staring the name of a variable with an upper case is OK from the language point of view, but it is nice to warn the user.
The refactoring technically can be performed, but there is a logical problem. For example the name of a local variable being extracted conflicts with another name in the scope, or duplicate parameter names in the method being extracted, or a conflict between a parameter name and a local variable, etc. In some cases the location of the problem is also provided, so the IDE can show user the location and the problem, and let the user decide whether they want to perform the refactoring. For example the name conflict might be expected, and the user wants to fix it afterwards.
A fatal error, which prevents performing the refactoring. For example the name of a local variable being extracted is not a valid identifier, or selection is not a valid expression.
A directive to remove an existing file content overlay. After processing this directive, the file contents will once again be read from the file system.
If this directive is used on a file that doesn't currently have a content overlay, it has no effect.
An indication of a problem with the execution of the server, typically in response to a request.
A code that uniquely identifies the error that occurred.
A short description of the error.
The stack trace associated with processing the request, used for debugging the plugin.
An enumeration of the types of errors that can occur in the execution of the plugin.
An "analysis.updateContent" request contained a ChangeContentOverlay object that can't be applied. This can happen for two reasons:
One of the method parameters was invalid.
An internal error occurred in the plugin while attempting to respond to a request. Also see the plugin.error notification for errors that occur outside of handling a request.
A request was received that the plugin does not recognize, or cannot handle in its current configuration.
A description of a set of edits that implement a single conceptual change.
A human-readable description of the change to be applied.
A list of the edits used to effect the change, grouped by file.
A list of the linked editing groups used to customize the changes that were made.
The position that should be selected after the edits have been applied.
The optional identifier of the change kind. The identifier remains stable even if the message changes, or is parameterized.
A description of a single change to a single file.
The offset of the region to be modified.
The length of the region to be modified.
The code that is to replace the specified region in the original code.
An identifier that uniquely identifies this source edit from other edits in the same response. This field is omitted unless a containing structure needs to be able to identify the edit for some reason.
For example, some refactoring operations can produce edits that might not be appropriate (referred to as potential edits). Such edits will have an id so that they can be referenced. Edits in the same response that do not need to be referenced will not have an id.
A description of a set of changes to a single file.
The file containing the code to be modified.
The modification stamp of the file at the moment when the change was created, in milliseconds since the "Unix epoch". Will be -1 if the file did not exist and should be created. The client may use this field to make sure that the file was not changed since then, so it is safe to apply the change.
A list of the edits used to effect the change.
A watch event sent by the server when the file system has been modified.
The type of change represented by this event.
The absolute path of the file or directory that changed.
An indication of the type of change associated with a watch event.
An indication that the file or directory was added.
An indication that the file was modified.
An indication that the file or directory was removed.
This section contains additional information for each kind of refactoring. In addition to a brief description of the refactoring, there is a specification of the feedback that is provided when a refactoring is requested using the edit.getRefactoring request (designed to improve the UX) and the options that may be provided to edit.getRefactoring.
Convert a getter into a method by removing the keyword get and adding an empty parameter list.
It is an error if the range contains anything other than all or part of the name of a single getter.
none
none
Convert a method into a getter by adding the keyword get and removing the parameter list.
It is an error if the range contains anything other than all or part of the name of a single method or if the method has a non-empty parameter list.
none
none
Create a local variable initialized by the expression that covers the specified selection.
It is an error if the selection range is not covered by a complete expression.
The offsets of the expressions that cover the specified selection, from the down most to the up most.
The lengths of the expressions that cover the specified selection, from the down most to the up most.
The proposed names for the local variable.
The offsets of the expressions that would be replaced by a reference to the variable.
The lengths of the expressions that would be replaced by a reference to the variable. The lengths correspond to the offsets. In other words, for a given expression, if the offset of that expression is offsets[i], then the length of that expression is lengths[i].
The name that the local variable should be given.
True if all occurrences of the expression within the scope in which the variable will be defined should be replaced by a reference to the local variable. The expression used to initiate the refactoring will always be replaced.
Create a method whose body is the specified expression or list of statements, possibly augmented with a return statement.
It is an error if the range contains anything other than a complete expression (no partial expressions are allowed) or a complete sequence of statements.
The offset to the beginning of the expression or statements that will be extracted.
The length of the expression or statements that will be extracted.
The proposed return type for the method. If the returned element does not have a declared return type, this field will contain an empty string.
The proposed names for the method.
True if a getter could be created rather than a method.
The proposed parameters for the method.
The offsets of the expressions or statements that would be replaced by an invocation of the method.
The lengths of the expressions or statements that would be replaced by an invocation of the method. The lengths correspond to the offsets. In other words, for a given expression (or block of statements), if the offset of that expression is offsets[i], then the length of that expression is lengths[i].
The return type that should be defined for the method.
True if a getter should be created rather than a method. It is an error if this field is true and the list of parameters is non-empty.
The name that the method should be given.
The parameters that should be defined for the method.
It is an error if a REQUIRED or NAMED parameter follows a POSITIONAL parameter. It is an error if a REQUIRED or POSITIONAL parameter follows a NAMED parameter.
True if all occurrences of the expression or statements should be replaced by an invocation of the method. The expression or statements used to initiate the refactoring will always be replaced.
Inline the initializer expression of a local variable in place of any references to that variable.
It is an error if the range contains anything other than all or part of the name of a single local variable.
The name of the variable being inlined.
The number of times the variable occurs.
none
Inline a method in place of one or all references to that method.
It is an error if the range contains anything other than all or part of the name of a single method.
The name of the class enclosing the method being inlined. If not a class member is being inlined, this field will be absent.
The name of the method (or function) being inlined.
True if the declaration of the method is selected and all references should be inlined.
True if the method being inlined should be removed. It is an error if this field is true and inlineAll is false.
True if all invocations of the method should be inlined, or false if only the invocation site used to create this refactoring should be inlined.
Move the given file and update all of the references to that file and from it. The move operation is supported in general case - for renaming a file in the same folder, moving it to a different folder or both.
The refactoring must be activated before an actual file moving operation is performed.
The "offset" and "length" fields from the request are ignored, but the file specified in the request specifies the file to be moved.
none
The new file path to which the given file is being moved.
Rename a given element and all of the references to that element.
It is an error if the range contains anything other than all or part of the name of a single function (including methods, getters and setters), variable (including fields, parameters and local variables), class or function type.
The offset to the beginning of the name selected to be renamed.
The length of the name selected to be renamed.
The human-readable description of the kind of element being renamed (such as “class” or “function type alias”).
The old name of the element before the refactoring.
The name that the element should have after the refactoring.