# Common Types

1.4.6

This document contains a specification of the types that are common between the analysis server wire protocol and the analysis server plugin wire protocol. While those protocols are versioned, the common types are not versioned separately.

When those protocols have identical definitions of a type, the type definition should be removed from the two individual specifications and added to this document. Two definitions of a type are identical if the HTML that defines the types is identical and if all of the types referenced by those two types are identical.

When it becomes necessary to change the definition of a common type in one protocol such that the type will no longer be common, that type and any types that reference that type must be removed from this document and added to both of the documents that include this document.

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.

An indication of an error, warning, or hint that was produced by the analysis.

An enumeration of the possible severities of analysis errors.

`INFO` `WARNING` `ERROR`

An enumeration of the possible types of analysis errors.

`CHECKED_MODE_COMPILE_TIME_ERROR` `COMPILE_TIME_ERROR` `HINT` `LINT` `STATIC_TYPE_WARNING` `STATIC_WARNING` `SYNTACTIC_ERROR` `TODO`

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.

A suggestion for how to complete partially entered text. Many of the fields are optional, depending on the kind of element being suggested.

An enumeration of the kinds of elements that can be included in a completion suggestion.

`ARGUMENT_LIST`

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.

`IMPORT` `IDENTIFIER`

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.

`INVOCATION`

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.

`KEYWORD`

A keyword is being suggested. For suggestions of this kind, the completion is the keyword.

`NAMED_ARGUMENT`

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.

`OPTIONAL_ARGUMENT` `OVERRIDE`

An overriding implementation of a class member is being suggested.

`PARAMETER` `PACKAGE_NAME`

The name of a pub package is being suggested.

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.

Information about an element (something that can be declared in code).

An enumeration of the kinds of elements.

`CLASS` `CLASS_TYPE_ALIAS` `COMPILATION_UNIT` `CONSTRUCTOR` `CONSTRUCTOR_INVOCATION` `ENUM` `ENUM_CONSTANT` `EXTENSION` `EXTENSION_TYPE` `FIELD` `FILE` `FUNCTION` `FUNCTION_INVOCATION` `FUNCTION_TYPE_ALIAS` `GETTER` `LABEL` `LIBRARY` `LOCAL_VARIABLE` `METHOD` `MIXIN` `PARAMETER` `PREFIX` `SETTER` `TOP_LEVEL_VARIABLE` `TYPE_ALIAS` `TYPE_PARAMETER` `UNIT_TEST_GROUP` `UNIT_TEST_TEST` `UNKNOWN` String

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.

`ANNOTATIONS` `BLOCK` `CLASS_BODY` `COMMENT` `DIRECTIVES` `DOCUMENTATION_COMMENT` `FILE_HEADER` `FUNCTION_BODY` `INVOCATION` `LITERAL` `PARAMETERS`

A description of a region that can be folded.

A description of a region that could have special highlighting associated with it.

An enumeration of the kinds of highlighting that can be applied to files.

`ANNOTATION` `BUILT_IN` `CLASS` `COMMENT_BLOCK` `COMMENT_DOCUMENTATION` `COMMENT_END_OF_LINE` `CONSTRUCTOR` `CONSTRUCTOR_TEAR_OFF` `DIRECTIVE` `DYNAMIC_TYPE`

Deprecated - no longer sent.

`DYNAMIC_LOCAL_VARIABLE_DECLARATION` `DYNAMIC_LOCAL_VARIABLE_REFERENCE` `DYNAMIC_PARAMETER_DECLARATION` `DYNAMIC_PARAMETER_REFERENCE` `ENUM` `ENUM_CONSTANT` `EXTENSION` `EXTENSION_TYPE` `FIELD`

Deprecated - no longer sent.

`FIELD_STATIC`

Deprecated - no longer sent.

`FUNCTION`

Deprecated - no longer sent.

`FUNCTION_DECLARATION`

Deprecated - no longer sent.

`FUNCTION_TYPE_ALIAS` `GETTER_DECLARATION`

Deprecated - no longer sent.

`IDENTIFIER_DEFAULT` `IMPORT_PREFIX` `INSTANCE_FIELD_DECLARATION` `INSTANCE_FIELD_REFERENCE` `INSTANCE_GETTER_DECLARATION` `INSTANCE_GETTER_REFERENCE` `INSTANCE_METHOD_DECLARATION` `INSTANCE_METHOD_REFERENCE` `INSTANCE_METHOD_TEAR_OFF` `INSTANCE_SETTER_DECLARATION` `INSTANCE_SETTER_REFERENCE` `INVALID_STRING_ESCAPE` `KEYWORD` `LABEL` `LIBRARY_NAME` `LITERAL_BOOLEAN` `LITERAL_DOUBLE` `LITERAL_INTEGER` `LITERAL_LIST` `LITERAL_MAP` `LITERAL_RECORD` `LITERAL_STRING` `LOCAL_FUNCTION_DECLARATION` `LOCAL_FUNCTION_REFERENCE` `LOCAL_FUNCTION_TEAR_OFF` `LOCAL_VARIABLE`

Deprecated - no longer sent.

`LOCAL_VARIABLE_DECLARATION` `LOCAL_VARIABLE_REFERENCE` `METHOD`

Deprecated - no longer sent.

`METHOD_DECLARATION`

Deprecated - no longer sent.

`METHOD_DECLARATION_STATIC`

Deprecated - no longer sent.

`METHOD_STATIC`

Deprecated - no longer sent.

`MIXIN` `PARAMETER`

Deprecated - no longer sent.

`SETTER_DECLARATION`

Deprecated - no longer sent.

`TOP_LEVEL_VARIABLE`

Deprecated - no longer sent.

`PARAMETER_DECLARATION` `PARAMETER_REFERENCE` `STATIC_FIELD_DECLARATION` `STATIC_GETTER_DECLARATION` `STATIC_GETTER_REFERENCE` `STATIC_METHOD_DECLARATION` `STATIC_METHOD_REFERENCE` `STATIC_METHOD_TEAR_OFF` `STATIC_SETTER_DECLARATION` `STATIC_SETTER_REFERENCE` `TOP_LEVEL_FUNCTION_DECLARATION` `TOP_LEVEL_FUNCTION_REFERENCE` `TOP_LEVEL_FUNCTION_TEAR_OFF` `TOP_LEVEL_GETTER_DECLARATION` `TOP_LEVEL_GETTER_REFERENCE` `TOP_LEVEL_SETTER_DECLARATION` `TOP_LEVEL_SETTER_REFERENCE` `TOP_LEVEL_VARIABLE_DECLARATION` `TYPE_ALIAS` `TYPE_NAME_DYNAMIC` `TYPE_PARAMETER` `UNRESOLVED_INSTANCE_MEMBER_REFERENCE` `VALID_STRING_ESCAPE`

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.

Edit groups may have a length of 0 and function as tabstops where there is no default text, for example, an edit that inserts an `if` statement might provide an empty group between parens where a condition should be typed. For this reason, it's also valid for a group to contain only a single position that is not linked to others.

A suggestion of a value that could be used to replace all of the linked edit regions in a LinkedEditGroup.

An enumeration of the kind of values that can be suggested for a linked edit.

`METHOD` `PARAMETER` `TYPE` `VARIABLE`

A location (character range) within a file.

A description of a region from which the user can navigate to the declaration of an element.

A description of a target to which the user can navigate.

A description of the references to a single element within a single file.

An node in the outline structure of a file.

A description of a member that is being overridden.

An enumeration of the types of parameters.

`OPTIONAL_NAMED`

An optional named parameter.

`OPTIONAL_POSITIONAL`

An optional positional parameter.

`REQUIRED_NAMED`

A required named parameter.

`REQUIRED_POSITIONAL`

A required positional parameter.

A position within a file.

An enumeration of the kinds of refactorings that can be created.

`CONVERT_GETTER_TO_METHOD` `CONVERT_METHOD_TO_GETTER` `EXTRACT_LOCAL_VARIABLE` `EXTRACT_METHOD` `EXTRACT_WIDGET` `INLINE_LOCAL_VARIABLE` `INLINE_METHOD` `MOVE_FILE` `RENAME`

A description of a parameter in a method refactoring.

An enumeration of the kinds of parameters.

`REQUIRED` `POSITIONAL` `NAMED`

A description of a problem related to a refactoring.

An enumeration of the severities of problems that can be returned by the refactoring requests.

`INFO`

A minor code problem. No example, because it is not used yet.

`WARNING`

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.

`ERROR`

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.

`FATAL`

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.

A description of a set of edits that implement a single conceptual change.

A description of a single change to a single file.

A description of a set of changes to a single file.