Skip to main content
API module

types API

All 554 public APIs exported from the types module, with declarations, documentation, and source-backed examples.

Generated from typings/index.d.ts @ 555f5ceon

types

DocumentUri

A tagging type for string properties that are actually document URIs.

Source

Type definition

export type DocumentUri = string;
Kind
type alias
Declaration
typings/index.d.ts:16
types

integer

Defines an integer in the range of -2^31 to 2^31 - 1.

Source

Type definition

export type integer = number;
Kind
type alias
Declaration
typings/index.d.ts:24
types

uinteger

Defines an unsigned integer in the range of 0 to 2^31 - 1.

Source

Type definition

export type uinteger = number;
Kind
type alias
Declaration
typings/index.d.ts:33
types

decimal

Defines a decimal number. Since decimal numbers are very rare in the language server specification we denote the exact range with every decimal using the mathematics interval notations (e.g. [0, 1] denotes all decimals d with 0 <= d <= 1.

Source

Type definition

export type decimal = number;
Kind
type alias
Declaration
typings/index.d.ts:46
types

LSPAny

The LSP any type.

In the current implementation we map LSPAny to any. This is due to the fact that the TypeScript compilers can't infer string access signatures for interface correctly (it can though for types). See the following issue for details: microsoft/TypeScript issue #15300.

When the issue is addressed LSPAny can be defined as follows:

export type LSPAny = LSPObject | LSPArray | string | integer | uinteger | decimal | boolean | null | undefined;
export type LSPObject = { [key: string]: LSPAny };
export type LSPArray = LSPAny[];

Please note that strictly speaking a property with the value undefined can't be converted into JSON preserving the property name. However for convenience it is allowed and assumed that all these properties are optional as well.

Source

Type definition

export type LSPAny = any;
Kind
type alias
Declaration
typings/index.d.ts:70
types

LSPObject

Type alias exported by coc.nvim.

Source

Type definition

export type LSPObject = object;
Kind
type alias
Declaration
typings/index.d.ts:71
types

LSPArray

Type alias exported by coc.nvim.

Source

Type definition

export type LSPArray = any[];
Kind
type alias
Declaration
typings/index.d.ts:72
types

Position

Position in a text document expressed as zero-based line and character offset. Prior to 3.17 the offsets were always based on a UTF-16 string representation. So a string of the form a𐐀b the character offset of the character a is 0, the character offset of 𐐀 is 1 and the character offset of b is 3 since 𐐀 is represented using two code units in UTF-16. Since 3.17 clients and servers can agree on a different string encoding representation (e.g. UTF-8). The client announces it's supported encoding via the client capability general.positionEncodings. The value is an array of position encodings the client supports, with decreasing preference (e.g. the encoding at index 0 is the most preferred one). To stay backwards compatible the only mandatory encoding is UTF-16 represented via the string utf-16. The server can pick one of the encodings offered by the client and signals that encoding back to the client via the initialize result's property capabilities.positionEncoding. If the string value utf-16 is missing from the client's capability general.positionEncodings servers can safely assume that the client supports UTF-16. If the server omits the position encoding in its initialize result the encoding defaults to the string value utf-16. Implementation considerations: since the conversion from one encoding into another requires the content of the file / line the conversion is best done where the file is read which is usually on the server side.

Positions are line end character agnostic. So you can not specify a position that denotes \r|\n or \n| where | represents the character offset.

Source

Interface definition

export interface Position {
    line: uinteger;
    character: uinteger;
}

Members

line: uinteger;

Line position in a document (zero-based).

If a line number is greater than the number of lines in a document, it defaults back to the number of lines in the document. If a line number is negative, it defaults to 0.

character: uinteger;

Character offset on a line in a document (zero-based).

The meaning of this offset is determined by the negotiated PositionEncodingKind.

If the character value is greater than the line length it defaults back to the line length.

Kind
interface
Declaration
typings/index.d.ts:102
types

Range

A range in a text document expressed as (zero-based) start and end positions.

If you want to specify a range that contains a line including the line ending character(s) then use an end position denoting the start of the next line. For example:

{
    start: { line: 5, character: 23 }
    end : { line 6, character : 0 }
}
Source

Interface definition

export interface Range {
    start: Position;
    end: Position;
}

Members

start: Position;

The range's start position.

end: Position;

The range's end position.

Kind
interface
Declaration
typings/index.d.ts:150
types

Location

Represents a location inside a resource, such as a line inside a text file.

Source

Interface definition

export interface Location {
    uri: DocumentUri;
    range: Range;
}

Members

uri: DocumentUri;

The document URI of the location.

range: Range;

The range of the location.

Kind
interface
Declaration
typings/index.d.ts:188
types

Color

Represents a color in RGBA space.

Source

Interface definition

export interface Color {
    readonly red: decimal;
    readonly green: decimal;
    readonly blue: decimal;
    readonly alpha: decimal;
}

Members

readonly red: decimal;

The red component of this color in the range [0-1].

readonly green: decimal;

The green component of this color in the range [0-1].

readonly blue: decimal;

The blue component of this color in the range [0-1].

readonly alpha: decimal;

The alpha component of this color in the range [0-1].

Kind
interface
Declaration
typings/index.d.ts:263
types

ColorInformation

Represents a color range from a document.

Source

Interface definition

export interface ColorInformation {
    range: Range;
    color: Color;
}

Members

range: Range;

The range in the document where this color appears.

color: Color;

The actual color value for this color range.

Kind
interface
Declaration
typings/index.d.ts:298
types

ColorPresentation

Interface exported by coc.nvim.

Source

Interface definition

export interface ColorPresentation {
    label: string;
    textEdit?: TextEdit;
    additionalTextEdits?: TextEdit[];
}

Members

label: string;

The label of this color presentation. It will be shown on the color picker header. By default this is also the text that is inserted when selecting this color presentation.

textEdit?: TextEdit;

An edit which is applied to a document when selecting this presentation for the color. When falsy the label is used.

additionalTextEdits?: TextEdit[];

An optional array of additional text edits that are applied when selecting this color presentation. Edits must not overlap with the main edit nor with themselves.

Kind
interface
Declaration
typings/index.d.ts:322
types

FoldingRangeKind

A predefined folding range kind.

The type is a string since the value set is extensible

Source

Type definition

export type FoldingRangeKind = string;
Kind
type alias
Declaration
typings/index.d.ts:377
types

FoldingRange

Represents a folding range. To be valid, start and end line must be bigger than zero and smaller than the number of lines in the document. Clients are free to ignore invalid ranges.

Source

Interface definition

export interface FoldingRange {
    startLine: uinteger;
    startCharacter?: uinteger;
    endLine: uinteger;
    endCharacter?: uinteger;
    kind?: FoldingRangeKind;
    collapsedText?: string;
}

Members

startLine: uinteger;

The zero-based start line of the range to fold. The folded area starts after the line's last character. To be valid, the end must be zero or larger and smaller than the number of lines in the document.

startCharacter?: uinteger;

The zero-based character offset from where the folded range starts. If not defined, defaults to the length of the start line.

endLine: uinteger;

The zero-based end line of the range to fold. The folded area ends with the line's last character. To be valid, the end must be zero or larger and smaller than the number of lines in the document.

endCharacter?: uinteger;

The zero-based character offset before the folded range ends. If not defined, defaults to the length of the end line.

kind?: FoldingRangeKind;

Describes the kind of the folding range such as `comment' or 'region'. The kind is used to categorize folding ranges and used by commands like 'Fold all comments'. See FoldingRangeKind for an enumeration of standardized kinds.

collapsedText?: string;

The text that the client should show when the specified range is collapsed. If not defined or not supported by the client, a default will be chosen by the client.

Kind
interface
Declaration
typings/index.d.ts:382
types

DiagnosticRelatedInformation

Represents a related message and source code location for a diagnostic. This should be used to point to code locations that cause or related to a diagnostics, e.g when duplicating a symbol in a scope.

Source

Interface definition

export interface DiagnosticRelatedInformation {
    location: Location;
    message: string;
}

Members

location: Location;

The location of this related diagnostic information.

message: string;

The message of this related diagnostic information.

Kind
interface
Declaration
typings/index.d.ts:435
types

DiagnosticSeverity

Type alias exported by coc.nvim.

Source

Type definition

export type DiagnosticSeverity = 1 | 2 | 3 | 4;
Kind
type alias
Declaration
typings/index.d.ts:480
types

DiagnosticTag

Type alias exported by coc.nvim.

Source

Type definition

export type DiagnosticTag = 1 | 2;
Kind
type alias
Declaration
typings/index.d.ts:501
types

CodeDescription

Structure to capture a description for an error code.

Source

Interface definition

export interface CodeDescription {
    href: string;
}

Members

href: string;

An URI to open with more information about the diagnostic error.

Kind
interface
Declaration
typings/index.d.ts:507
types

Diagnostic

Represents a diagnostic, such as a compiler error or warning. Diagnostic objects are only valid in the scope of a resource.

Source

Interface definition

export interface Diagnostic {
    range: Range;
    severity?: DiagnosticSeverity;
    code?: integer | string;
    codeDescription?: CodeDescription;
    source?: string;
    message: string;
    tags?: DiagnosticTag[];
    relatedInformation?: DiagnosticRelatedInformation[];
    data?: LSPAny;
}

Members

range: Range;

The range at which the message applies

severity?: DiagnosticSeverity;

The diagnostic's severity. Can be omitted. If omitted it is up to the client to interpret diagnostics as error, warning, info or hint.

code?: integer | string;

The diagnostic's code, which usually appear in the user interface.

codeDescription?: CodeDescription;

An optional property to describe the error code. Requires the code field (above) to be present/not null.

source?: string;

A human-readable string describing the source of this diagnostic, e.g. 'typescript' or 'super lint'. It usually appears in the user interface.

message: string;

The diagnostic's message. It usually appears in the user interface

tags?: DiagnosticTag[];

Additional metadata about the diagnostic.

relatedInformation?: DiagnosticRelatedInformation[];

An array of related diagnostic information, e.g. when symbol-names within a scope collide all definitions can be marked via this property.

data?: LSPAny;

A data entry field that is preserved between a textDocument/publishDiagnostics notification and textDocument/codeAction request.

Kind
interface
Declaration
typings/index.d.ts:525
types

Command

Represents a reference to a command. Provides a title which will be used to represent a command in the UI and, optionally, an array of arguments which will be passed to the command handler function when invoked.

Source

Interface definition

export interface Command {
    title: string;
    command: string;
    arguments?: LSPAny[];
}

Members

title: string;

Title of the command, like save.

command: string;

The identifier of the actual command handler.

arguments?: LSPAny[];

Arguments that the command handler should be invoked with.

Kind
interface
Declaration
typings/index.d.ts:614
types

TextEdit

A text edit applicable to a text document.

Source

Interface definition

export interface TextEdit {
    range: Range;
    newText: string;
}

Members

range: Range;

The range of the text document to be manipulated. To insert text into a document create a range where start === end.

newText: string;

The string to be inserted. For delete operations use an empty string.

Kind
interface
Declaration
typings/index.d.ts:646
types

ChangeAnnotation

Additional information that describes document changes.

Source

Interface definition

export interface ChangeAnnotation {
    label: string;
    needsConfirmation?: boolean;
    description?: string;
}

Members

label: string;

A human-readable string describing the actual change. The string is rendered prominent in the user interface.

needsConfirmation?: boolean;

A flag which indicates that user confirmation is needed before applying the change.

description?: string;

A human-readable string which is rendered less prominent in the user interface.

Kind
interface
Declaration
typings/index.d.ts:687
types

ChangeAnnotationIdentifier

An identifier to refer to a change annotation stored with a workspace edit.

Source

Type definition

export type ChangeAnnotationIdentifier = string;
Kind
type alias
Declaration
typings/index.d.ts:714
types

TextDocumentEdit

Describes textual changes on a text document. A TextDocumentEdit describes all changes on a document version Si and after they are applied move the document to version Si+1. So the creator of a TextDocumentEdit doesn't need to sort the array of edits or do any kind of ordering. However the edits must be non overlapping.

Source

Interface definition

export interface TextDocumentEdit {
    textDocument: OptionalVersionedTextDocumentIdentifier;
    edits: (TextEdit | AnnotatedTextEdit | SnippetTextEdit)[];
}

Members

textDocument: OptionalVersionedTextDocumentIdentifier;

The text document to change.

edits: (TextEdit | AnnotatedTextEdit | SnippetTextEdit)[];

The edits to be applied.

Kind
interface
Declaration
typings/index.d.ts:758
types

CreateFileOptions

Options to create a file.

Source

Interface definition

export interface CreateFileOptions {
    overwrite?: boolean;
    ignoreIfExists?: boolean;
}

Members

overwrite?: boolean;

Overwrite existing file. Overwrite wins over ignoreIfExists

ignoreIfExists?: boolean;

Ignore if exists.

Kind
interface
Declaration
typings/index.d.ts:803
types

RenameFileOptions

Rename file options

Source

Interface definition

export interface RenameFileOptions {
    overwrite?: boolean;
    ignoreIfExists?: boolean;
}

Members

overwrite?: boolean;

Overwrite target if existing. Overwrite wins over ignoreIfExists

ignoreIfExists?: boolean;

Ignores if target exists.

Kind
interface
Declaration
typings/index.d.ts:837
types

DeleteFileOptions

Delete file options

Source

Interface definition

export interface DeleteFileOptions {
    recursive?: boolean;
    ignoreIfNotExists?: boolean;
}

Members

recursive?: boolean;

Delete the content recursively if a folder is denoted.

ignoreIfNotExists?: boolean;

Ignore the operation if the file doesn't exist.

Kind
interface
Declaration
typings/index.d.ts:875
types

WorkspaceEdit

A workspace edit represents changes to many resources managed in the workspace. The edit should either provide changes or documentChanges. If documentChanges are present they are preferred over changes if the client can handle versioned document edits.

Since version 3.13.0 a workspace edit can contain resource operations as well. If resource operations are present clients need to execute the operations in the order in which they are provided. So a workspace edit for example can consist of the following two changes: (1) a create file a.txt and (2) a text document edit which insert text into file a.txt.

An invalid sequence (e.g. (1) delete file a.txt and (2) insert text into file a.txt) will cause failure of the operation. How the client recovers from the failure is described by the client capability: workspace.workspaceEdit.failureHandling

Source

Interface definition

export interface WorkspaceEdit {
    changes?: {
        [uri: DocumentUri]: TextEdit[];
    };
    documentChanges?: (TextDocumentEdit | CreateFile | RenameFile | DeleteFile)[];
    changeAnnotations?: {
        [id: ChangeAnnotationIdentifier]: ChangeAnnotation;
    };
}

Members

changes?: { [uri: DocumentUri]: TextEdit[]; };

Holds changes to existing resources.

documentChanges?: (TextDocumentEdit | CreateFile | RenameFile | DeleteFile)[];

Depending on the client capability workspace.workspaceEdit.resourceOperations document changes are either an array of TextDocumentEdits to express changes to n different text documents where each text document edit addresses a specific version of a text document. Or it can contain above TextDocumentEdits mixed with create, rename and delete file / folder operations.

Whether a client supports versioned document edits is expressed via workspace.workspaceEdit.documentChanges client capability.

If a client neither supports documentChanges nor workspace.workspaceEdit.resourceOperations then only plain TextEdits using the changes property are supported.

changeAnnotations?: { [id: ChangeAnnotationIdentifier]: ChangeAnnotation; };

A map of change annotations that can be referenced in AnnotatedTextEdits or create, rename and delete file / folder operations.

Whether clients honor this property depends on the client capability workspace.changeAnnotationSupport.

Kind
interface
Declaration
typings/index.d.ts:920
types

TextEditChange

A change to capture text edits for existing resources.

Source

Interface definition

export interface TextEditChange {
    all(): (TextEdit | AnnotatedTextEdit)[];
    clear(): void;
    add(edit: TextEdit | AnnotatedTextEdit): void;
    insert(position: Position, newText: string): void;
    insert(position: Position, newText: string, annotation: ChangeAnnotation | ChangeAnnotationIdentifier): ChangeAnnotationIdentifier;
    replace(range: Range, newText: string): void;
    replace(range: Range, newText: string, annotation?: ChangeAnnotation | ChangeAnnotationIdentifier): ChangeAnnotationIdentifier;
    delete(range: Range): void;
    delete(range: Range, annotation?: ChangeAnnotation | ChangeAnnotationIdentifier): ChangeAnnotationIdentifier;
}

Members

all(): (TextEdit | AnnotatedTextEdit)[];

Gets all text edits for this change.

clear(): void;

Clears the edits for this change.

add(edit: TextEdit | AnnotatedTextEdit): void;

Adds a text edit.

insert(position: Position, newText: string): void;

Insert the given text at the given position.

insert(position: Position, newText: string, annotation: ChangeAnnotation | ChangeAnnotationIdentifier): ChangeAnnotationIdentifier;

Insert the given text at the given position with an annotation.

replace(range: Range, newText: string): void;

Replace the given range with given text for the given resource.

replace(range: Range, newText: string, annotation?: ChangeAnnotation | ChangeAnnotationIdentifier): ChangeAnnotationIdentifier;

Replace the given range with given text with an annotation.

delete(range: Range): void;

Delete the text at the given range.

delete(range: Range, annotation?: ChangeAnnotation | ChangeAnnotationIdentifier): ChangeAnnotationIdentifier;

Delete the text at the given range with an annotation.

Kind
interface
Declaration
typings/index.d.ts:958
types

WorkspaceChange

A workspace change helps constructing changes to a workspace.

Source

Class definition

export class WorkspaceChange {
    private _workspaceEdit;
    private _textEditChanges;
    private _changeAnnotations;
    constructor(workspaceEdit?: WorkspaceEdit);
    get edit(): WorkspaceEdit;
    getTextEditChange(textDocument: OptionalVersionedTextDocumentIdentifier): TextEditChange;
    getTextEditChange(uri: DocumentUri): TextEditChange;
    private initDocumentChanges;
    private initChanges;
    createFile(uri: DocumentUri, options?: CreateFileOptions): void;
    createFile(uri: DocumentUri, annotation: ChangeAnnotation | ChangeAnnotationIdentifier, options?: CreateFileOptions): ChangeAnnotationIdentifier;
    renameFile(oldUri: DocumentUri, newUri: DocumentUri, options?: RenameFileOptions): void;
    renameFile(oldUri: DocumentUri, newUri: DocumentUri, annotation?: ChangeAnnotation | ChangeAnnotationIdentifier, options?: RenameFileOptions): ChangeAnnotationIdentifier;
    deleteFile(uri: DocumentUri, options?: DeleteFileOptions): void;
    deleteFile(uri: DocumentUri, annotation: ChangeAnnotation | ChangeAnnotationIdentifier, options?: DeleteFileOptions): ChangeAnnotationIdentifier;
}

Members

private _workspaceEdit;
private _textEditChanges;
private _changeAnnotations;
constructor(workspaceEdit?: WorkspaceEdit);
get edit(): WorkspaceEdit;

Returns the underlying WorkspaceEdit literal use to be returned from a workspace edit operation like rename.

getTextEditChange(textDocument: OptionalVersionedTextDocumentIdentifier): TextEditChange;

Returns the TextEditChange to manage text edits for resources.

getTextEditChange(uri: DocumentUri): TextEditChange;
private initDocumentChanges;
private initChanges;
createFile(uri: DocumentUri, options?: CreateFileOptions): void;

Create a file in the workspace edit.

createFile(uri: DocumentUri, annotation: ChangeAnnotation | ChangeAnnotationIdentifier, options?: CreateFileOptions): ChangeAnnotationIdentifier;

Create a file in the workspace edit with an annotation.

renameFile(oldUri: DocumentUri, newUri: DocumentUri, options?: RenameFileOptions): void;

Rename a file in the workspace edit.

renameFile(oldUri: DocumentUri, newUri: DocumentUri, annotation?: ChangeAnnotation | ChangeAnnotationIdentifier, options?: RenameFileOptions): ChangeAnnotationIdentifier;

Rename a file in the workspace edit with an annotation.

deleteFile(uri: DocumentUri, options?: DeleteFileOptions): void;

Delete a file in the workspace edit.

deleteFile(uri: DocumentUri, annotation: ChangeAnnotation | ChangeAnnotationIdentifier, options?: DeleteFileOptions): ChangeAnnotationIdentifier;

Delete a file in the workspace edit with an annotation.

Kind
class
Declaration
typings/index.d.ts:1020
types

TextDocumentIdentifier

A literal to identify a text document in the client.

Source

Interface definition

export interface TextDocumentIdentifier {
    uri: DocumentUri;
}

Members

uri: DocumentUri;

The text document's uri.

Kind
interface
Declaration
typings/index.d.ts:1066
types

OptionalVersionedTextDocumentIdentifier

A text document identifier to optionally denote a specific version of a text document.

Source

Interface definition

export interface OptionalVersionedTextDocumentIdentifier extends TextDocumentIdentifier {
    version: integer | null;
}

Members

version: integer | null;

The version number of this document. If a versioned text document identifier is sent from the server to the client and the file is not open in the editor (the server has not received an open notification before) the server can send null to indicate that the version is unknown and the content on disk is the truth (as specified with document content ownership).

Kind
interface
Declaration
typings/index.d.ts:1115
types

TextDocumentItem

An item to transfer a text document from the client to the server.

Source

Interface definition

export interface TextDocumentItem {
    uri: DocumentUri;
    languageId: string;
    version: integer;
    text: string;
}

Members

uri: DocumentUri;

The text document's uri.

languageId: string;

The text document's language identifier.

version: integer;

The version number of this document (it will increase after each change, including undo/redo).

text: string;

The content of the opened text document.

Kind
interface
Declaration
typings/index.d.ts:1145
types

MarkupKind

Type alias exported by coc.nvim.

Source

Type definition

export type MarkupKind = 'plaintext' | 'markdown';
Kind
type alias
Declaration
typings/index.d.ts:1203
types

MarkupContent

A MarkupContent literal represents a string value which content is interpreted base on its kind flag. Currently the protocol supports plaintext and markdown as markup kinds.

If the kind is markdown then the value can contain fenced code blocks like in GitHub issues. See GitHub documentation

Here is an example how such a string can be constructed using JavaScript / TypeScript:

let markdown: MarkdownContent = {
 kind: MarkupKind.Markdown,
 value: [
   '# Header',
   'Some text',
   '```typescript',
   'someCode();',
   '```'
 ].join('\n')
};

Please Note that clients might sanitize the return markdown. A client could decide to remove HTML from the markdown to avoid script execution.

Source

Interface definition

export interface MarkupContent {
    kind: MarkupKind;
    value: string;
}

Members

kind: MarkupKind;

The type of the Markup

value: string;

The content itself

Kind
interface
Declaration
typings/index.d.ts:1228
types

CompletionItemKind

Type alias exported by coc.nvim.

Source

Type definition

export type CompletionItemKind = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25;
Kind
type alias
Declaration
typings/index.d.ts:1274
types

InsertTextFormat

Type alias exported by coc.nvim.

Source

Type definition

export type InsertTextFormat = 1 | 2;
Kind
type alias
Declaration
typings/index.d.ts:1296
types

CompletionItemTag

Type alias exported by coc.nvim.

Source

Type definition

export type CompletionItemTag = 1;
Kind
type alias
Declaration
typings/index.d.ts:1309
types

InsertReplaceEdit

A special text edit to provide an insert and a replace operation.

Source

Interface definition

export interface InsertReplaceEdit {
    newText: string;
    insert: Range;
    replace: Range;
}

Members

newText: string;

The string to be inserted.

insert: Range;

The range if the insert is requested

replace: Range;

The range if the replace is requested.

Kind
interface
Declaration
typings/index.d.ts:1315
types

InsertTextMode

Type alias exported by coc.nvim.

Source

Type definition

export type InsertTextMode = 1 | 2;
Kind
type alias
Declaration
typings/index.d.ts:1370
types

CompletionItemLabelDetails

Additional details for a completion item label.

Source

Interface definition

export interface CompletionItemLabelDetails {
    detail?: string;
    description?: string;
}

Members

detail?: string;

An optional string which is rendered less prominently directly after label, without any spacing. Should be used for function signatures and type annotations.

description?: string;

An optional string which is rendered less prominently after . Should be used for fully qualified names and file paths.

Kind
interface
Declaration
typings/index.d.ts:1376
types

CompletionItem

A completion item represents a text snippet that is proposed to complete text that is being typed.

Source

Interface definition

export interface CompletionItem {
    label: string;
    labelDetails?: CompletionItemLabelDetails;
    kind?: CompletionItemKind;
    tags?: CompletionItemTag[];
    detail?: string;
    documentation?: string | MarkupContent;
    deprecated?: boolean;
    preselect?: boolean;
    sortText?: string;
    filterText?: string;
    insertText?: string;
    insertTextFormat?: InsertTextFormat;
    insertTextMode?: InsertTextMode;
    textEdit?: TextEdit | InsertReplaceEdit;
    textEditText?: string;
    additionalTextEdits?: TextEdit[];
    commitCharacters?: string[];
    command?: Command;
    data?: LSPAny;
}

Members

label: string;

The label of this completion item.

The label property is also by default the text that is inserted when selecting this completion.

If label details are provided the label itself should be an unqualified name of the completion item.

labelDetails?: CompletionItemLabelDetails;

Additional details for the label

kind?: CompletionItemKind;

The kind of this completion item. Based of the kind an icon is chosen by the editor.

tags?: CompletionItemTag[];

Tags for this completion item.

detail?: string;

A human-readable string with additional information about this item, like type or symbol information.

documentation?: string | MarkupContent;

A human-readable string that represents a doc-comment.

deprecated?: boolean;

Indicates if this item is deprecated.

preselect?: boolean;

Select this item when showing.

Note that only one completion item can be selected and that the tool / client decides which item that is. The rule is that the first item of those that match best is selected.

sortText?: string;

A string that should be used when comparing this item with other items. When falsy the label is used.

filterText?: string;

A string that should be used when filtering a set of completion items. When falsy the label is used.

insertText?: string;

A string that should be inserted into a document when selecting this completion. When falsy the label is used.

The insertText is subject to interpretation by the client side. Some tools might not take the string literally. For example VS Code when code complete is requested in this example con<cursor position> and a completion item with an insertText of console is provided it will only insert sole. Therefore it is recommended to use textEdit instead since it avoids additional client side interpretation.

insertTextFormat?: InsertTextFormat;

The format of the insert text. The format applies to both the insertText property and the newText property of a provided textEdit. If omitted defaults to InsertTextFormat.PlainText.

Please note that the insertTextFormat doesn't apply to additionalTextEdits.

insertTextMode?: InsertTextMode;

How whitespace and indentation is handled during completion item insertion. If not provided the clients default value depends on the textDocument.completion.insertTextMode client capability.

textEdit?: TextEdit | InsertReplaceEdit;

An edit which is applied to a document when selecting this completion. When an edit is provided the value of insertText is ignored.

Most editors support two different operations when accepting a completion item. One is to insert a completion text and the other is to replace an existing text with a completion text. Since this can usually not be predetermined by a server it can report both ranges. Clients need to signal support for InsertReplaceEdits via the textDocument.completion.insertReplaceSupport client capability property.

Note 1: The text edit's range as well as both ranges from an insert replace edit must be a [single line] and they must contain the position at which completion has been requested. Note 2: If an InsertReplaceEdit is returned the edit's insert range must be a prefix of the edit's replace range, that means it must be contained and starting at the same position.

textEditText?: string;

The edit text used if the completion item is part of a CompletionList and CompletionList defines an item default for the text edit range.

Clients will only honor this property if they opt into completion list item defaults using the capability completionList.itemDefaults.

If not provided and a list's default range is provided the label property is used as a text.

additionalTextEdits?: TextEdit[];

An optional array of additional text edits that are applied when selecting this completion. Edits must not overlap (including the same insert position) with the main edit nor with themselves.

Additional text edits should be used to change text unrelated to the current cursor position (for example adding an import statement at the top of the file if the completion item will insert an unqualified type).

commitCharacters?: string[];

An optional set of characters that when pressed while this completion is active will accept it first and then type that character. Note that all commit characters should have length=1 and that superfluous characters will be ignored.

command?: Command;

An optional command that is executed after inserting this completion. Note that additional modifications to the current document should be described with the additionalTextEdits-property.

data?: LSPAny;

A data entry field that is preserved on a completion item between a CompletionRequest and a CompletionResolveRequest.

Kind
interface
Declaration
typings/index.d.ts:1395
types

CompletionList

Represents a collection of completion items to be presented in the editor.

Source

Interface definition

export interface CompletionList {
    isIncomplete: boolean;
    itemDefaults?: {
        commitCharacters?: string[];
        editRange?: Range | {
            insert: Range;
            replace: Range;
        };
        insertTextFormat?: InsertTextFormat;
        insertTextMode?: InsertTextMode;
        data?: LSPAny;
    };
    items: CompletionItem[];
}

Members

isIncomplete: boolean;

This list it not complete. Further typing results in recomputing this list.

Recomputed lists have all their items replaced (not appended) in the incomplete completion sessions.

itemDefaults?: { commitCharacters?: string[]; editRange?: Range | { insert: Range; replace: Range; }; insertTextFormat?: InsertTextFormat; insertTextMode?: InsertTextMode; data?: LSPAny; };

In many cases the items of an actual completion result share the same value for properties like commitCharacters or the range of a text edit. A completion list can therefore define item defaults which will be used if a completion item itself doesn't specify the value.

If a completion list specifies a default value and a completion item also specifies a corresponding value the one from the item is used.

Servers are only allowed to return default values if the client signals support for this via the completionList.itemDefaults capability.

items: CompletionItem[];

The completion items.

Kind
interface
Declaration
typings/index.d.ts:1567
types

MarkedString

MarkedString can be used to render human readable text. It is either a markdown string or a code-block that provides a language and a code snippet. The language identifier is semantically equal to the optional language identifier in fenced code blocks in GitHub issues. See GitHub documentation

The pair of a language and a value is an equivalent to markdown:

${value}

Note that markdown strings will be sanitized - that means html will be escaped.

Source

Type definition

export type MarkedString = string | {
    language: string;
    value: string;
};
Kind
type alias
Declaration
typings/index.d.ts:1657
types

ParameterInformation

Represents a parameter of a callable-signature. A parameter can have a label and a doc-comment.

Source

Interface definition

export interface ParameterInformation {
    label: string | [
        uinteger,
        uinteger
    ];
    documentation?: string | MarkupContent;
}

Members

label: string | [ uinteger, uinteger ];

The label of this parameter information.

Either a string or an inclusive start and exclusive end offsets within its containing signature label. (see SignatureInformation.label). The offsets are based on a UTF-16 string representation as Position and Range does.

Note: a label of type string should be a substring of its containing signature label. Its intended use case is to highlight the parameter label part in the SignatureInformation.label.

documentation?: string | MarkupContent;

The human-readable doc-comment of this parameter. Will be shown in the UI but can be omitted.

Kind
interface
Declaration
typings/index.d.ts:1697
types

SignatureInformation

Represents the signature of something callable. A signature can have a label, like a function-name, a doc-comment, and a set of parameters.

Source

Interface definition

export interface SignatureInformation {
    label: string;
    documentation?: string | MarkupContent;
    parameters?: ParameterInformation[];
    activeParameter?: uinteger;
}

Members

label: string;

The label of this signature. Will be shown in the UI.

documentation?: string | MarkupContent;

The human-readable doc-comment of this signature. Will be shown in the UI but can be omitted.

parameters?: ParameterInformation[];

The parameters of this signature.

activeParameter?: uinteger;

The index of the active parameter.

If provided, this is used in place of SignatureHelp.activeParameter.

Kind
interface
Declaration
typings/index.d.ts:1733
types

SignatureHelp

Signature help represents the signature of something callable. There can be multiple signature but only one active and only one active parameter.

Source

Interface definition

export interface SignatureHelp {
    signatures: SignatureInformation[];
    activeSignature?: uinteger;
    activeParameter?: uinteger;
}

Members

signatures: SignatureInformation[];

One or more signatures.

activeSignature?: uinteger;

The active signature. If omitted or the value lies outside the range of signatures the value defaults to zero or is ignored if the SignatureHelp has no signatures.

Whenever possible implementors should make an active decision about the active signature and shouldn't rely on a default value.

In future version of the protocol this property might become mandatory to better express this.

activeParameter?: uinteger;

The active parameter of the active signature. If omitted or the value lies outside the range of signatures[activeSignature].parameters defaults to 0 if the active signature has parameters. If the active signature has no parameters it is ignored. In future version of the protocol this property might become mandatory to better express the active parameter if the active signature does have any.

Kind
interface
Declaration
typings/index.d.ts:1769
types

Definition

The definition of a symbol represented as one or many locations. For most programming languages there is only one location at which a symbol is defined.

Servers should prefer returning DefinitionLink over Definition if supported by the client.

Source

Type definition

export type Definition = Location | Location[];
Kind
type alias
Declaration
typings/index.d.ts:1805
types

ReferenceContext

Value-object that contains additional information when requesting references.

Source

Interface definition

export interface ReferenceContext {
    includeDeclaration: boolean;
}

Members

includeDeclaration: boolean;

Include the declaration of the current symbol.

Kind
interface
Declaration
typings/index.d.ts:1831
types

DocumentHighlightKind

Type alias exported by coc.nvim.

Source

Type definition

export type DocumentHighlightKind = 1 | 2 | 3;
Kind
type alias
Declaration
typings/index.d.ts:1854
types

DocumentHighlight

A document highlight is a range inside a text document which deserves special attention. Usually a document highlight is visualized by changing the background color of its range.

Source

Interface definition

export interface DocumentHighlight {
    range: Range;
    kind?: DocumentHighlightKind;
}

Members

range: Range;

The range this highlight applies to.

kind?: DocumentHighlightKind;

The highlight kind, default is text.

Kind
interface
Declaration
typings/index.d.ts:1860
types

SymbolKind

Type alias exported by coc.nvim.

Source

Type definition

export type SymbolKind = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26;
Kind
type alias
Declaration
typings/index.d.ts:1913
types

SymbolTag

Type alias exported by coc.nvim.

Source

Type definition

export type SymbolTag = 1;
Kind
type alias
Declaration
typings/index.d.ts:1925
types

BaseSymbolInformation

A base for all symbol information.

Source

Interface definition

export interface BaseSymbolInformation {
    name: string;
    kind: SymbolKind;
    tags?: SymbolTag[];
    containerName?: string;
}

Members

name: string;

The name of this symbol.

kind: SymbolKind;

The kind of this symbol.

tags?: SymbolTag[];

Tags for this symbol.

containerName?: string;

The name of the symbol containing this symbol. This information is for user interface purposes (e.g. to render a qualifier in the user interface if necessary). It can't be used to re-infer a hierarchy for the document symbols.

Kind
interface
Declaration
typings/index.d.ts:1929
types

SymbolInformation

Represents information about programming constructs like variables, classes, interfaces etc.

Source

Interface definition

export interface SymbolInformation extends BaseSymbolInformation {
    deprecated?: boolean;
    location: Location;
}

Members

deprecated?: boolean;

Indicates if this symbol is deprecated.

location: Location;

The location of this symbol. The location's range is used by a tool to reveal the location in the editor. If the symbol is selected in the tool the range's start information is used to position the cursor. So the range usually spans more than the actual symbol's name and does normally include things like visibility modifiers.

The range doesn't have to denote a node range in the sense of an abstract syntax tree. It can therefore not be used to re-construct a hierarchy of the symbols.

Kind
interface
Declaration
typings/index.d.ts:1956
types

WorkspaceSymbol

A special workspace symbol that supports locations without a range.

See also SymbolInformation.

Source

Interface definition

export interface WorkspaceSymbol extends BaseSymbolInformation {
    location: Location | {
        uri: DocumentUri;
    };
    data?: LSPAny;
}

Members

location: Location | { uri: DocumentUri; };

The location of the symbol. Whether a server is allowed to return a location without a range depends on the client capability workspace.symbol.resolveSupport.

See SymbolInformation#location for more details.

data?: LSPAny;

A data entry field that is preserved on a workspace symbol between a workspace symbol request and a workspace symbol resolve request.

Kind
interface
Declaration
typings/index.d.ts:1995
types

DocumentSymbol

Represents programming constructs like variables, classes, interfaces etc. that appear in a document. Document symbols can be hierarchical and they have two ranges: one that encloses its definition and one that points to its most interesting range, e.g. the range of an identifier.

Source

Interface definition

export interface DocumentSymbol {
    name: string;
    detail?: string;
    kind: SymbolKind;
    tags?: SymbolTag[];
    deprecated?: boolean;
    range: Range;
    selectionRange: Range;
    children?: DocumentSymbol[];
}

Members

name: string;

The name of this symbol. Will be displayed in the user interface and therefore must not be an empty string or a string only consisting of white spaces.

detail?: string;

More detail for this symbol, e.g the signature of a function.

kind: SymbolKind;

The kind of this symbol.

tags?: SymbolTag[];

Tags for this document symbol.

deprecated?: boolean;

Indicates if this symbol is deprecated.

range: Range;

The range enclosing this symbol not including leading/trailing whitespace but everything else like comments. This information is typically used to determine if the clients cursor is inside the symbol to reveal in the symbol in the UI.

selectionRange: Range;

The range that should be selected and revealed when this symbol is being picked, e.g the name of a function. Must be contained by the range.

children?: DocumentSymbol[];

Children of this symbol, e.g. properties of a class.

Kind
interface
Declaration
typings/index.d.ts:2030
types

CodeActionKind

The kind of a code action.

Kinds are a hierarchical list of identifiers separated by ., e.g. "refactor.extract.function".

The set of kinds is open and client needs to announce the kinds it supports to the server during initialization.

Source

Type definition

export type CodeActionKind = string;
Kind
type alias
Declaration
typings/index.d.ts:2097
types

CodeActionTriggerKind

Type alias exported by coc.nvim.

Source

Type definition

export type CodeActionTriggerKind = 1 | 2;
Kind
type alias
Declaration
typings/index.d.ts:2208
types

CodeActionContext

Contains additional diagnostic information about the context in which a code action is run.

Source

Interface definition

export interface CodeActionContext {
    diagnostics: Diagnostic[];
    only?: CodeActionKind[];
    triggerKind?: CodeActionTriggerKind;
}

Members

diagnostics: Diagnostic[];

An array of diagnostics known on the client side overlapping the range provided to the textDocument/codeAction request. They are provided so that the server knows which errors are currently presented to the user for the given range. There is no guarantee that these accurately reflect the error state of the resource. The primary parameter to compute code actions is the provided range.

only?: CodeActionKind[];

Requested kind of actions to return.

Actions not of this kind are filtered out by the client before being shown. So servers can omit computing them.

triggerKind?: CodeActionTriggerKind;

The reason why code actions were requested.

Kind
interface
Declaration
typings/index.d.ts:2213
types

CodeAction

A code action represents a change that can be performed in code, e.g. to fix a problem or to refactor code.

A CodeAction must set either edit and/or a command. If both are supplied, the edit is applied first, then the command is executed.

Source

Interface definition

export interface CodeAction {
    title: string;
    kind?: CodeActionKind;
    diagnostics?: Diagnostic[];
    isPreferred?: boolean;
    disabled?: {
        reason: string;
    };
    edit?: WorkspaceEdit;
    command?: Command;
    data?: LSPAny;
}

Members

title: string;

A short, human-readable, title for this code action.

kind?: CodeActionKind;

The kind of the code action.

Used to filter code actions.

diagnostics?: Diagnostic[];

The diagnostics that this code action resolves.

isPreferred?: boolean;

Marks this as a preferred action. Preferred actions are used by the auto fix command and can be targeted by keybindings.

A quick fix should be marked preferred if it properly addresses the underlying error. A refactoring should be marked preferred if it is the most reasonable choice of actions to take.

disabled?: { reason: string; };

Marks that the code action cannot currently be applied.

Clients should follow the following guidelines regarding disabled code actions:

  • Disabled code actions are not shown in automatic lightbulbs code action menus.

  • Disabled actions are shown as faded out in the code action menu when the user requests a more specific type of code action, such as refactorings.

  • If the user has a keybinding that auto applies a code action and only disabled code actions are returned, the client should show the user an error message with reason in the editor.

edit?: WorkspaceEdit;

The workspace edit this code action performs.

command?: Command;

A command this code action executes. If a code action provides an edit and a command, first the edit is executed and then the command.

data?: LSPAny;

A data entry field that is preserved on a code action between a textDocument/codeAction and a codeAction/resolve request.

Kind
interface
Declaration
typings/index.d.ts:2256
types

CodeLens

A code lens represents a command that should be shown along with source text, like the number of references, a way to run tests, etc.

A code lens is unresolved when no command is associated to it. For performance reasons the creation of a code lens and resolving should be done in two stages.

Source

Interface definition

export interface CodeLens {
    range: Range;
    command?: Command;
    data?: LSPAny;
}

Members

range: Range;

The range in which this code lens is valid. Should only span a single line.

command?: Command;

The command this code lens represents.

data?: LSPAny;

A data entry field that is preserved on a code lens item between a CodeLensRequest and a CodeLensResolveRequest.

Kind
interface
Declaration
typings/index.d.ts:2357
types

FormattingOptions

Value-object describing what options formatting should use.

Source

Interface definition

export interface FormattingOptions {
    tabSize: uinteger;
    insertSpaces: boolean;
    trimTrailingWhitespace?: boolean;
    insertFinalNewline?: boolean;
    trimFinalNewlines?: boolean;
    [key: string]: boolean | integer | string | undefined;
}

Members

tabSize: uinteger;

Size of a tab in spaces.

insertSpaces: boolean;

Prefer spaces over tabs.

trimTrailingWhitespace?: boolean;

Trim trailing whitespace on a line.

insertFinalNewline?: boolean;

Insert a newline character at the end of the file if one does not exist.

trimFinalNewlines?: boolean;

Trim all newlines after the final newline at the end of the file.

[key: string]: boolean | integer | string | undefined;

Signature for further properties.

Kind
interface
Declaration
typings/index.d.ts:2389
types

SelectionRange

A selection range represents a part of a selection hierarchy. A selection range may have a parent selection range that contains it.

Source

Interface definition

export interface SelectionRange {
    range: Range;
    parent?: SelectionRange;
}

Members

range: Range;

The range of this selection range.

parent?: SelectionRange;

The parent selection range containing this range. Therefore parent.range must contain this.range.

Kind
interface
Declaration
typings/index.d.ts:2482
types

CallHierarchyItem

Represents programming constructs like functions or constructors in the context of call hierarchy.

Source

Interface definition

export interface CallHierarchyItem {
    name: string;
    kind: SymbolKind;
    tags?: SymbolTag[];
    detail?: string;
    uri: DocumentUri;
    range: Range;
    selectionRange: Range;
    data?: LSPAny;
}

Members

name: string;

The name of this item.

kind: SymbolKind;

The kind of this item.

tags?: SymbolTag[];

Tags for this item.

detail?: string;

More detail for this item, e.g. the signature of a function.

uri: DocumentUri;

The resource identifier of this item.

range: Range;

The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g. comments and code.

selectionRange: Range;

The range that should be selected and revealed when this symbol is being picked, e.g. the name of a function. Must be contained by the range.

data?: LSPAny;

A data entry field that is preserved between a call hierarchy prepare and incoming calls or outgoing calls requests.

Kind
interface
Declaration
typings/index.d.ts:2511
types

CallHierarchyIncomingCall

Represents an incoming call, e.g. a caller of a method or constructor.

Source

Interface definition

export interface CallHierarchyIncomingCall {
    from: CallHierarchyItem;
    fromRanges: Range[];
}

Members

from: CallHierarchyItem;

The item that makes the call.

fromRanges: Range[];

The ranges at which the calls appear. This is relative to the caller denoted by this.from.

Kind
interface
Declaration
typings/index.d.ts:2552
types

CallHierarchyOutgoingCall

Represents an outgoing call, e.g. calling a getter from a method or a method from a constructor etc.

Source

Interface definition

export interface CallHierarchyOutgoingCall {
    to: CallHierarchyItem;
    fromRanges: Range[];
}

Members

to: CallHierarchyItem;

The item that is called.

fromRanges: Range[];

The range at which this item is called. This is the range relative to the caller, e.g the item passed to provideCallHierarchyOutgoingCalls and not this.to.

Kind
interface
Declaration
typings/index.d.ts:2568
types

SemanticTokenTypes

A set of predefined token types. This set is not fixed an clients can specify additional token types via the corresponding client capabilities.

Source

Enum definition

export enum SemanticTokenTypes {
    namespace = "namespace",
    type = "type",
    class = "class",
    enum = "enum",
    interface = "interface",
    struct = "struct",
    typeParameter = "typeParameter",
    parameter = "parameter",
    variable = "variable",
    property = "property",
    enumMember = "enumMember",
    event = "event",
    function = "function",
    method = "method",
    macro = "macro",
    keyword = "keyword",
    modifier = "modifier",
    comment = "comment",
    string = "string",
    number = "number",
    regexp = "regexp",
    operator = "operator",
    decorator = "decorator",
    label = "label"
}

Members

namespace = "namespace"
type = "type"

Represents a generic type. Acts as a fallback for types which can't be mapped to a specific type like class or enum.

class = "class"
enum = "enum"
interface = "interface"
struct = "struct"
typeParameter = "typeParameter"
parameter = "parameter"
variable = "variable"
property = "property"
enumMember = "enumMember"
event = "event"
function = "function"
method = "method"
macro = "macro"
keyword = "keyword"
modifier = "modifier"
comment = "comment"
string = "string"
number = "number"
regexp = "regexp"
operator = "operator"
decorator = "decorator"
label = "label"
Kind
enum
Declaration
typings/index.d.ts:2587
types

SemanticTokenModifiers

A set of predefined token modifiers. This set is not fixed an clients can specify additional token types via the corresponding client capabilities.

Source

Enum definition

export enum SemanticTokenModifiers {
    declaration = "declaration",
    definition = "definition",
    readonly = "readonly",
    static = "static",
    deprecated = "deprecated",
    abstract = "abstract",
    async = "async",
    modification = "modification",
    documentation = "documentation",
    defaultLibrary = "defaultLibrary"
}

Members

declaration = "declaration"
definition = "definition"
readonly = "readonly"
static = "static"
deprecated = "deprecated"
abstract = "abstract"
async = "async"
modification = "modification"
documentation = "documentation"
defaultLibrary = "defaultLibrary"
Kind
enum
Declaration
typings/index.d.ts:2630
types

SemanticTokensLegend

Interface exported by coc.nvim.

Source

Interface definition

export interface SemanticTokensLegend {
    tokenTypes: string[];
    tokenModifiers: string[];
}

Members

tokenTypes: string[];

The token types a server uses.

tokenModifiers: string[];

The token modifiers a server uses.

Kind
interface
Declaration
typings/index.d.ts:2645
types

SemanticTokens

Interface exported by coc.nvim.

Source

Interface definition

export interface SemanticTokens {
    resultId?: string;
    data: uinteger[];
}

Members

resultId?: string;

An optional result id. If provided and clients support delta updating the client will include the result id in the next semantic token request. A server can then instead of computing all semantic tokens again simply send a delta.

data: uinteger[];

The actual tokens.

Kind
interface
Declaration
typings/index.d.ts:2658
types

SemanticTokensEdit

Interface exported by coc.nvim.

Source

Interface definition

export interface SemanticTokensEdit {
    start: uinteger;
    deleteCount: uinteger;
    data?: uinteger[];
}

Members

start: uinteger;

The start offset of the edit.

deleteCount: uinteger;

The count of elements to remove.

data?: uinteger[];

The elements to insert.

Kind
interface
Declaration
typings/index.d.ts:2680
types

SemanticTokensDelta

Interface exported by coc.nvim.

Source

Interface definition

export interface SemanticTokensDelta {
    readonly resultId?: string;
    edits: SemanticTokensEdit[];
}

Members

readonly resultId?: string;

The result id of the delta, undefined when the delta is a full result.

edits: SemanticTokensEdit[];

The semantic token edits to transform a previous result into a new result.

Kind
interface
Declaration
typings/index.d.ts:2697
types

InlineValueText

Provide inline value as text.

Source

Type definition

export type InlineValueText = {
    range: Range;
    text: string;
};
Kind
type alias
Declaration
typings/index.d.ts:2756
types

InlineValueVariableLookup

Provide inline value through a variable lookup. If only a range is specified, the variable name will be extracted from the underlying document. An optional variable name can be used to override the extracted name.

Source

Type definition

export type InlineValueVariableLookup = {
    range: Range;
    variableName?: string;
    caseSensitiveLookup: boolean;
};
Kind
type alias
Declaration
typings/index.d.ts:2785
types

InlineValueEvaluatableExpression

Provide an inline value through an expression evaluation. If only a range is specified, the expression will be extracted from the underlying document. An optional expression can be used to override the extracted expression.

Source

Type definition

export type InlineValueEvaluatableExpression = {
    range: Range;
    expression?: string;
};
Kind
type alias
Declaration
typings/index.d.ts:2819
types

InlineValue

Inline value information can be provided by different means:

  • directly as a text value (class InlineValueText).
  • as a name to use for a variable lookup (class InlineValueVariableLookup)
  • as an evaluatable expression (class InlineValueEvaluatableExpression) The InlineValue types combines all inline value types into one type.
Source

Type definition

export type InlineValue = InlineValueText | InlineValueVariableLookup | InlineValueEvaluatableExpression;
Kind
type alias
Declaration
typings/index.d.ts:2851
types

InlineValueContext

Type alias exported by coc.nvim.

Source

Type definition

export type InlineValueContext = {
    frameId: integer;
    stoppedLocation: Range;
};
Kind
type alias
Declaration
typings/index.d.ts:2855
types

InlayHintKind

Type alias exported by coc.nvim.

Source

Type definition

export type InlayHintKind = 1 | 2;
Kind
type alias
Declaration
typings/index.d.ts:2898
types

InlayHintLabelPart

An inlay hint label part allows for interactive and composite labels of inlay hints.

Source

Type definition

export type InlayHintLabelPart = {
    value: string;
    tooltip?: string | MarkupContent;
    location?: Location;
    command?: Command;
};
Kind
type alias
Declaration
typings/index.d.ts:2905
types

WorkspaceFolder

A workspace folder inside a client.

Source

Interface definition

export interface WorkspaceFolder {
    uri: string;
    name: string;
}

Members

uri: string;

The associated URI for this workspace folder.

name: string;

The name of the workspace folder. Used to refer to this workspace folder in the user interface.

Kind
interface
Declaration
typings/index.d.ts:3005
types

TextDocument

A simple text document. Not to be implemented. The document keeps the content as string.

Source

Interface definition

export interface TextDocument {
    readonly uri: DocumentUri;
    readonly languageId: string;
    readonly version: integer;
    getText(range?: Range): string;
    positionAt(offset: uinteger): Position;
    offsetAt(position: Position): uinteger;
    readonly lineCount: uinteger;
}

Members

readonly uri: DocumentUri;

The associated URI for this document. Most documents have the file-scheme, indicating that they represent files on disk. However, some documents may have other schemes indicating that they are not available on disk.

readonly languageId: string;

The identifier of the language associated with this document.

readonly version: integer;

The version number of this document (it will increase after each change, including undo/redo).

getText(range?: Range): string;

Get the text of this document. A substring can be retrieved by providing a range.

positionAt(offset: uinteger): Position;

Converts a zero-based offset to a position.

offsetAt(position: Position): uinteger;

Converts the position to a zero-based offset. Invalid positions are adjusted as described in Position.line and Position.character.

readonly lineCount: uinteger;

The number of lines in this document.

Kind
interface
Declaration
typings/index.d.ts:3024
types

InlineCompletionOption

Interface exported by coc.nvim.

Source

Interface definition

export interface InlineCompletionOption {
    provider?: string;
    autoTrigger?: boolean;
}

Members

provider?: string;

The provider name, extension name or LanguageClient id.

autoTrigger?: boolean;

Set trigger kind to InlineCompletionTriggerKind.Automatic when true.

Kind
interface
Declaration
typings/index.d.ts:3099
types

InlineCompletionTriggerKind

Type alias exported by coc.nvim.

Source

Type definition

export type InlineCompletionTriggerKind = 1 | 2;
Kind
type alias
Declaration
typings/index.d.ts:3110
types

SelectedCompletionInfo

Describes the currently selected completion item.

Source

Type definition

export type SelectedCompletionInfo = {
    range: Range;
    text: string;
};
Kind
type alias
Declaration
typings/index.d.ts:3115
types

StringValue

A string value used as a snippet is a template which allows to insert text and to control the editor cursor when insertion happens.

A snippet can define tab stops and placeholders with $1, $2 and ${3:foo}. $0 defines the final tab stop, it defaults to the end of the snippet. Variables are defined with $name and ${name:default value}.

Source

Type definition

export type StringValue = {
    kind: 'snippet';
    value: string;
};
Kind
type alias
Declaration
typings/index.d.ts:3157
types

InlineCompletionItem

An inline completion item represents a text snippet that is proposed inline to complete text that is being typed.

Source

Interface definition

export interface InlineCompletionItem {
    insertText: string | StringValue;
    filterText?: string;
    range?: Range;
    command?: Command;
}

Members

insertText: string | StringValue;

The text to replace the range with. Must be set.

filterText?: string;

A text that is used to decide if this inline completion should be shown. When falsy the is used.

range?: Range;

The range to replace. Must begin and end on the same line.

command?: Command;

An optional that is executed after inserting this completion.

Kind
interface
Declaration
typings/index.d.ts:3175
types

ApplyKind

Defines how values from a set of defaults and an individual item will be merged.

Source

Type definition

export type ApplyKind = 1 | 2;
Kind
type alias
Declaration
typings/index.d.ts:3255
types

WorkspaceEditMetadata

Additional data about a workspace edit.

Source

Type definition

export type WorkspaceEditMetadata = {
    isRefactoring?: boolean;
};
Kind
type alias
Declaration
typings/index.d.ts:3260
types

ApplyWorkspaceEditParams

The parameters passed via an apply workspace edit request.

Source

Interface definition

export interface ApplyWorkspaceEditParams {
    label?: string;
    edit: WorkspaceEdit;
    metadata?: WorkspaceEditMetadata;
}

Members

label?: string;

An optional label of the workspace edit. This label is presented in the user interface for example on an undo stack to undo the workspace edit.

edit: WorkspaceEdit;

The edits to apply.

metadata?: WorkspaceEditMetadata;

Additional data about the edit.

Kind
interface
Declaration
typings/index.d.ts:3269
types

ApplyWorkspaceEditResult

The result returned from the apply workspace edit request.

Source

Interface definition

export interface ApplyWorkspaceEditResult {
    applied: boolean;
    failureReason?: string;
    failedChange?: uinteger;
}

Members

applied: boolean;

Indicates whether the edit was applied or not.

failureReason?: string;

An optional textual description for why the edit was not applied. This may be used by the server for diagnostic logging or to provide a suitable error for a request that triggered the edit.

failedChange?: uinteger;

Depending on the client's failure handling strategy failedChange might contain the index of the change that failed. This property is only available if the client signals a failureHandlingStrategy in its client capabilities.

Kind
interface
Declaration
typings/index.d.ts:3292
types

Thenable

Interface exported by coc.nvim.

Source

Interface definition

export interface Thenable<T> {
    then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => TResult | Thenable<TResult>): Thenable<TResult>;
    then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => void): Thenable<TResult>;
}

Members

then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => TResult | Thenable<TResult>): Thenable<TResult>;

Attaches callbacks for the resolution and/or rejection of the thenable.

then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => void): Thenable<TResult>;

Attaches a rejection callback to the thenable.

Kind
interface
Declaration
typings/index.d.ts:3313
types

Disposable

Interface exported by coc.nvim.

Source

Interface definition

export interface Disposable {
    dispose(): void;
}

Members

dispose(): void;

Dispose this object.

Kind
interface
Declaration
typings/index.d.ts:3325
types

TextDocumentContentChange

An event describing a change to a text document.

Source

Interface definition

export interface TextDocumentContentChange {
    range: Range;
    text: string;
}

Members

range: Range;

The range of the document that changed.

text: string;

The new text for the provided range.

Kind
interface
Declaration
typings/index.d.ts:3354
types

TextDocumentWillSaveEvent

An event that is fired when a document will be saved.

To make modifications to the document before it is being saved, call the waitUntil-function with a thenable that resolves to an array of text edits.

Source

Interface definition

export interface TextDocumentWillSaveEvent {
    document: LinesTextDocument;
    reason: 1 | 2 | 3;
}

Members

document: LinesTextDocument;

The document that will be saved.

reason: 1 | 2 | 3;

The reason why save was triggered.

Kind
interface
Declaration
typings/index.d.ts:3386
types

DocumentFilter

A document filter denotes a document by different properties like the language, the scheme of its resource, or a glob-pattern that is applied to the path.

Glob patterns can have the following syntax:

  • * to match one or more characters in a path segment
  • ? to match on one character in a path segment
  • ** to match any number of path segments, including none
  • {} to group conditions (e.g. **​/*.{ts,js} matches all TypeScript and JavaScript files)
  • [] to declare a range of characters to match in a path segment (e.g., example.[0-9] to match on example.0, example.1, …)
  • [!...] to negate a range of characters to match in a path segment (e.g., example.[!0-9] to match on example.a, example.b, but not example.0)
Source

Type definition

export type DocumentFilter = {
    language: string;
    scheme?: string;
    pattern?: string;
} | {
    language?: string;
    scheme: string;
    pattern?: string;
} | {
    language?: string;
    scheme?: string;
    pattern: string;
};
Kind
type alias
Declaration
typings/index.d.ts:3415
types

DocumentSelector

A language selector is the combination of one or many language identifiers and language filters.

Note that a document selector that is just a language identifier selects all documents, even those that are not saved on disk. Only use such selectors when a feature works without further context, e.g. without the need to resolve related 'files'.

Source

Type definition

export type DocumentSelector = DocumentFilter | string | ReadonlyArray<DocumentFilter | string>;
Kind
type alias
Declaration
typings/index.d.ts:3450
types

SignatureHelpTriggerKind

Type alias exported by coc.nvim.

Source

Type definition

export type SignatureHelpTriggerKind = 1 | 2 | 3;
Kind
type alias
Declaration
typings/index.d.ts:3470
types

SignatureHelpContext

Additional information about the context in which a signature help request was triggered.

Source

Interface definition

export interface SignatureHelpContext {
    triggerKind: SignatureHelpTriggerKind;
    triggerCharacter?: string;
    isRetrigger: boolean;
    activeSignatureHelp?: SignatureHelp;
}

Members

triggerKind: SignatureHelpTriggerKind;

Action that caused signature help to be triggered.

triggerCharacter?: string;

Character that caused signature help to be triggered.

This is undefined when triggerKind !== SignatureHelpTriggerKind.TriggerCharacter

isRetrigger: boolean;

true if signature help was already showing when it was triggered.

Retriggers occur when the signature help is already active and can be caused by actions such as typing a trigger character, a cursor move, or document content changes.

activeSignatureHelp?: SignatureHelp;

The currently active SignatureHelp.

The activeSignatureHelp has its SignatureHelp.activeSignature field updated based on the user navigating through available signatures.

Kind
interface
Declaration
typings/index.d.ts:3477
types

CompletionTriggerKind

Type alias exported by coc.nvim.

Source

Type definition

export type CompletionTriggerKind = 1 | 2 | 3;
Kind
type alias
Declaration
typings/index.d.ts:3524
types

CompletionContext

Contains additional information about the context in which a completion request is triggered.

Source

Interface definition

export interface CompletionContext {
    triggerKind: CompletionTriggerKind;
    triggerCharacter?: string;
    option: CompleteOption;
}

Members

triggerKind: CompletionTriggerKind;

How the completion was triggered.

triggerCharacter?: string;

The trigger character (a single character) that has trigger code complete. Is undefined if triggerKind !== CompletionTriggerKind.TriggerCharacter

option: CompleteOption;

The completion option of the current completion request.

Kind
interface
Declaration
typings/index.d.ts:3529
types

Event

Represents a typed event.

A function that represents an event to which you subscribe by calling it with a listener function as argument.

Source

Interface definition

export interface Event<T> {
    (listener: (e: T) => any, thisArgs?: any, disposables?: Disposable[]): Disposable;
}

Members

(listener: (e: T) => any, thisArgs?: any, disposables?: Disposable[]): Disposable;

A function that represents an event to which you subscribe by calling it with a listener function as argument.

Kind
interface
Declaration
typings/index.d.ts:3555
types

EmitterOptions

Interface exported by coc.nvim.

Source

Interface definition

export interface EmitterOptions {
    onFirstListenerAdd?: Function;
    onLastListenerRemove?: Function;
}

Members

onFirstListenerAdd?: Function;

Called when the first listener is added.

onLastListenerRemove?: Function;

Called when the last listener is removed.

Kind
interface
Declaration
typings/index.d.ts:3573
types

Emitter

Class exported by coc.nvim.

Source

Class definition

export class Emitter<T> {
    constructor(_options?: EmitterOptions | undefined);
    get event(): Event<T>;
    fire(event: T): any;
    dispose(): void;
}

Members

constructor(_options?: EmitterOptions | undefined);
get event(): Event<T>;

For the public to allow to subscribe to events from this Emitter

fire(event: T): any;

To be kept private to fire an event to subscribers

dispose(): void;

Dispose the emitter, remove all listeners.

Kind
class
Declaration
typings/index.d.ts:3584
types

CancellationToken

Defines a CancellationToken. This interface is not intended to be implemented. A CancellationToken must be created via a CancellationTokenSource.

Source

Interface definition

export interface CancellationToken {
    readonly isCancellationRequested: boolean;
    readonly onCancellationRequested: Event<any>;
}

Members

readonly isCancellationRequested: boolean;

Is true when the token has been cancelled, false otherwise.

readonly onCancellationRequested: Event<any>;

An event which fires upon cancellation.

Kind
interface
Declaration
typings/index.d.ts:3607
types

CancellationTokenSource

Class exported by coc.nvim.

Source

Class definition

export class CancellationTokenSource {
    get token(): CancellationToken;
    cancel(): void;
    dispose(): void;
}

Members

get token(): CancellationToken;

The cancellation token of this source.

cancel(): void;

Cancel the token, firing the cancellation event.

dispose(): void;

Dispose the source.

Kind
class
Declaration
typings/index.d.ts:3624
types

TextLine

Represents a line of text, such as a line of source code.

TextLine objects are immutable. When a document changes, previously retrieved lines will not represent the latest state.

Source

Interface definition

export interface TextLine {
    readonly lineNumber: number;
    readonly text: string;
    readonly range: Range;
    readonly rangeIncludingLineBreak: Range;
    readonly firstNonWhitespaceCharacterIndex: number;
    readonly isEmptyOrWhitespace: boolean;
}

Members

readonly lineNumber: number;

The zero-based line number.

readonly text: string;

The text of this line without the line separator characters.

readonly range: Range;

The range this line covers without the line separator characters.

readonly rangeIncludingLineBreak: Range;

The range this line covers with the line separator characters.

readonly firstNonWhitespaceCharacterIndex: number;

The offset of the first character which is not a whitespace character as defined by /\s/. Note that if a line is all whitespace the length of the line is returned.

readonly isEmptyOrWhitespace: boolean;

Whether this line is whitespace only, shorthand for === TextLine.text.length.

Kind
interface
Declaration
typings/index.d.ts:3645
types

LinesTextDocument

Interface exported by coc.nvim.

Source

Interface definition

export interface LinesTextDocument extends TextDocument {
    readonly length: number;
    readonly end: Position;
    readonly eol: boolean;
    readonly lines: ReadonlyArray<string>;
    lineAt(lineOrPos: number | Position): TextLine;
}

Members

readonly length: number;

Total length of TextDocument.

readonly end: Position;

End position of TextDocument.

readonly eol: boolean;

'eol' option of related buffer. When enabled additional \n will be added to the end of document content

readonly lines: ReadonlyArray<string>;

Lines of TextDocument.

lineAt(lineOrPos: number | Position): TextLine;

Returns a text line denoted by the line number. Note that the returned object is not live and changes to the document are not reflected.

Kind
interface
Declaration
typings/index.d.ts:3679
types

LinkedEditingRanges

The result of a linked editing range request.

Source

Interface definition

export interface LinkedEditingRanges {
    ranges: Range[];
    wordPattern?: string;
}

Members

ranges: Range[];

A list of ranges that can be edited together. The ranges must have identical length and contain identical text content. The ranges cannot overlap.

wordPattern?: string;

An optional word pattern (regular expression) that describes valid contents for the given ranges. If no pattern is provided, the client configuration's word pattern will be used.

Kind
interface
Declaration
typings/index.d.ts:3713
types

UniquenessLevel

Type alias exported by coc.nvim.

Source

Type definition

export type UniquenessLevel = 'document' | 'project' | 'group' | 'scheme' | 'global';
Kind
type alias
Declaration
typings/index.d.ts:3759
types

MonikerKind

Type alias exported by coc.nvim.

Source

Type definition

export type MonikerKind = 'import' | 'export' | 'local';
Kind
type alias
Declaration
typings/index.d.ts:3783
types

Moniker

Moniker definition to match LSIF 0.5 moniker definition.

Source

Interface definition

export interface Moniker {
    scheme: string;
    identifier: string;
    unique: UniquenessLevel;
    kind?: MonikerKind;
}

Members

scheme: string;

The scheme of the moniker. For example tsc or .Net

identifier: string;

The identifier of the moniker. The value is opaque in LSIF however schema owners are allowed to define the structure if they want.

unique: UniquenessLevel;

The scope in which the moniker is unique

kind?: MonikerKind;

The moniker kind if known.

Kind
interface
Declaration
typings/index.d.ts:3790
types

PreviousResultId

A previous result id in a workspace pull request.

Source

Type definition

export type PreviousResultId = {
    uri: string;
    value: string;
};
Kind
type alias
Declaration
typings/index.d.ts:3818
types

DocumentDiagnosticReportKind

Type alias exported by coc.nvim.

Source

Type definition

export type DocumentDiagnosticReportKind = 'full' | 'unchanged';
Kind
type alias
Declaration
typings/index.d.ts:3830
types

ErrorCodes

Type alias exported by coc.nvim.

Source

Type definition

export type ErrorCodes = number;
Kind
type alias
Declaration
typings/index.d.ts:3975
types

ResponseErrorLiteral

Interface exported by coc.nvim.

Source

Interface definition

export interface ResponseErrorLiteral<D = void> {
    code: number;
    message: string;
    data?: D;
}

Members

code: number;

A number indicating the error type that occurred.

message: string;

A string providing a short description of the error.

data?: D;

A Primitive or Structured value that contains additional information about the error. Can be omitted.

Kind
interface
Declaration
typings/index.d.ts:4032
types

ResponseError

An error object return in a response in case a request has failed.

Source

Class definition

export class ResponseError<D = void> extends Error {
    readonly code: number;
    readonly data: D | undefined;
    constructor(code: number, message: string, data?: D);
    toJson(): ResponseErrorLiteral<D>;
}

Members

readonly code: number;

Error code of the response.

readonly data: D | undefined;

Additional data of the error.

constructor(code: number, message: string, data?: D);
toJson(): ResponseErrorLiteral<D>;

Serialize to a JSON literal.

Kind
class
Declaration
typings/index.d.ts:4052
types

Message

A language server message

Source

Interface definition

export interface Message {
    jsonrpc: string;
}

Members

jsonrpc: string;

The protocol version, always "2.0".

Kind
interface
Declaration
typings/index.d.ts:4071
types

ResponseMessage

A response message.

Source

Interface definition

export interface ResponseMessage extends Message {
    id: number | string | null;
    result?: string | number | boolean | object | any[] | null;
    error?: ResponseErrorLiteral<any>;
}

Members

id: number | string | null;

The request id.

result?: string | number | boolean | object | any[] | null;

The result of a request. This member is REQUIRED on success. This member MUST NOT exist if there was an error invoking the method.

error?: ResponseErrorLiteral<any>;

The error object in case a request fails.

Kind
interface
Declaration
typings/index.d.ts:4092
types

VimValue

Type alias exported by coc.nvim.

Source

Type definition

type VimValue = number | boolean | string | number[] | {
    [key: string]: any;
};
Kind
type alias
Declaration
typings/index.d.ts:4110
types

VimClientInfo

Interface exported by coc.nvim.

Source

Interface definition

export interface VimClientInfo {
    name: string;
    version: {
        major?: number;
        minor?: number;
        patch?: number;
        prerelease?: string;
        commit?: string;
    };
    type: 'remote' | 'embedder' | 'host';
    methods?: {
        [index: string]: any;
    };
    attributes?: {
        [index: string]: any;
    };
}

Members

name: string;

Name of the client.

version: { major?: number; minor?: number; patch?: number; prerelease?: string; commit?: string; };

Version of the client.

type: 'remote' | 'embedder' | 'host';

Type of the client.

methods?: { [index: string]: any; };

Custom methods exposed by the client.

attributes?: { [index: string]: any; };

Custom attributes of the client.

Kind
interface
Declaration
typings/index.d.ts:4118
types

UiAttachOptions

Interface exported by coc.nvim.

Source

Interface definition

export interface UiAttachOptions {
    rgb?: boolean;
    ext_popupmenu?: boolean;
    ext_tabline?: boolean;
    ext_wildmenu?: boolean;
    ext_cmdline?: boolean;
    ext_linegrid?: boolean;
    ext_hlstate?: boolean;
}

Members

rgb?: boolean;

Enable rgb colors.

ext_popupmenu?: boolean;

Use external popupmenu.

ext_tabline?: boolean;

Use external tabline.

ext_wildmenu?: boolean;

Use external wildmenu.

ext_cmdline?: boolean;

Use external cmdline.

ext_linegrid?: boolean;

Use external linegrid.

ext_hlstate?: boolean;

Use external hlstate.

Kind
interface
Declaration
typings/index.d.ts:4166
types

ChanInfo

Interface exported by coc.nvim.

Source

Interface definition

export interface ChanInfo {
    id: number;
    stream: 'stdio' | 'stderr' | 'socket' | 'job';
    mode: 'bytes' | 'terminal' | 'rpc';
    pty?: number;
    buffer?: number;
    client?: VimClientInfo;
}

Members

id: number;

Channel id.

stream: 'stdio' | 'stderr' | 'socket' | 'job';

Stream type of the channel.

mode: 'bytes' | 'terminal' | 'rpc';

Mode of the channel.

pty?: number;

Pseudo terminal id when the channel is a terminal.

buffer?: number;

Buffer number of the terminal.

client?: VimClientInfo;

Client info when the channel is an rpc client.

Kind
interface
Declaration
typings/index.d.ts:4197
types

VimCommandDescription

Returned by nvim_get_commands api.

Source

Interface definition

export interface VimCommandDescription {
    name: string;
    bang: boolean;
    bar: boolean;
    register: boolean;
    definition: string;
    count?: number | null;
    script_id: number;
    complete?: string;
    nargs?: string;
    range?: string;
    complete_arg?: string;
}

Members

name: string;

Name of the command.

bang: boolean;

The command accepts a ! modifier.

bar: boolean;

The command supports a | separator.

register: boolean;

The command accepts a register argument.

definition: string;

Definition of the command.

count?: number | null;

Count argument accepted by the command.

script_id: number;

Id of the script that defines the command.

complete?: string;

Completion type of the command.

nargs?: string;

Number of arguments of the command.

range?: string;

Range specification of the command.

complete_arg?: string;

Completion argument of the command.

Kind
interface
Declaration
typings/index.d.ts:4227
types

NvimFloatOptions

Interface exported by coc.nvim.

Source

Interface definition

export interface NvimFloatOptions {
    standalone?: boolean;
    focusable?: boolean;
    relative?: 'editor' | 'cursor' | 'win' | 'mouse';
    anchor?: 'NW' | 'NE' | 'SW' | 'SE';
    border?: 'none' | 'single' | 'double' | 'rounded' | 'solid' | 'shadow' | string[];
    style?: 'minimal';
    title?: string;
    title_pos?: 'left' | 'center' | 'right';
    footer?: string | [
        string,
        string
    ][];
    footer_pos?: 'left' | 'center' | 'right';
    noautocmd?: boolean;
    fixed?: boolean;
    hide?: boolean;
    height: number;
    width: number;
    row: number;
    col: number;
}

Members

standalone?: boolean;

Keep the float window open when losing focus.

focusable?: boolean;

Whether the float window is focusable, default to true.

relative?: 'editor' | 'cursor' | 'win' | 'mouse';

Position relative to editor, cursor, window or mouse.

anchor?: 'NW' | 'NE' | 'SW' | 'SE';

Anchor corner of the float window.

border?: 'none' | 'single' | 'double' | 'rounded' | 'solid' | 'shadow' | string[];

Border style of the float window.

style?: 'minimal';

Style of the float window.

title?: string;

Title of the float window.

title_pos?: 'left' | 'center' | 'right';

Position of the title.

footer?: string | [ string, string ][];

Footer of the float window.

footer_pos?: 'left' | 'center' | 'right';

Position of the footer.

noautocmd?: boolean;

Do not trigger autocommands for the float window.

fixed?: boolean;

Do not change size or position when the parent changes.

hide?: boolean;

Hide the float window instead of closing it.

height: number;

Height of the float window.

width: number;

Width of the float window.

row: number;

Row of the float window.

col: number;

Column of the float window.

Kind
interface
Declaration
typings/index.d.ts:4274
types

ExtmarkOptions

Interface exported by coc.nvim.

Source

Interface definition

export interface ExtmarkOptions {
    id?: number;
    end_line?: number;
    end_col?: number;
    hl_group?: string;
    hl_mode?: 'replace' | 'combine' | 'blend';
    hl_eol?: boolean;
    virt_text?: [
        string,
        string | string[]
    ][];
    virt_text_pos?: 'eol' | 'overlay' | 'right_align' | 'inline';
    virt_text_win_col?: number;
    virt_text_hide?: boolean;
    virt_lines?: [
        string,
        string | string[]
    ][][];
    virt_lines_above?: boolean;
    virt_lines_leftcol?: boolean;
    right_gravity?: boolean;
    end_right_gravity?: boolean;
    priority?: number;
}

Members

id?: number;

Id of the extmark, used to update or remove it.

end_line?: number;

End line, 0-based inclusive.

end_col?: number;

End column, 0-based exclusive.

hl_group?: string;

Name of the highlight group used to highlight this mark.

hl_mode?: 'replace' | 'combine' | 'blend';

Highlight mode of the text.

hl_eol?: boolean;

Highlight to end of line when true.

virt_text?: [ string, string | string[] ][];

A list of [text, highlight] tuples.

virt_text_pos?: 'eol' | 'overlay' | 'right_align' | 'inline';

Position of virtual text.

virt_text_win_col?: number;

Window column of virtual text, used with overlay position.

virt_text_hide?: boolean;

Hide virtual text when the line is truncated.

virt_lines?: [ string, string | string[] ][][];

Virtual lines rendered below the mark.

virt_lines_above?: boolean;

Render virtual lines above the mark when true.

virt_lines_leftcol?: boolean;

Align virtual lines to the left.

right_gravity?: boolean;

The extmark is right gravity when true.

end_right_gravity?: boolean;

The end mark is right gravity when true.

priority?: number;

Priority of the extmark, higher renders on top.

Kind
interface
Declaration
typings/index.d.ts:4345
types

ExtmarkDetails

Interface exported by coc.nvim.

Source

Interface definition

export interface ExtmarkDetails {
    end_col: number;
    end_row: number;
    priority: number;
    hl_group?: string;
    virt_text?: [
        string,
        string
    ][];
    virt_lines?: [
        string,
        string | string
    ][][];
}

Members

end_col: number;

End column, 0-based exclusive.

end_row: number;

End row of the extmark.

priority: number;

Priority of the extmark.

hl_group?: string;

Highlight group of the extmark.

virt_text?: [ string, string ][];

Virtual text of the extmark.

virt_lines?: [ string, string | string ][][];

Virtual lines of the extmark.

Kind
interface
Declaration
typings/index.d.ts:4412
types

NvimProc

Interface exported by coc.nvim.

Source

Interface definition

export interface NvimProc {
    ppid: number;
    name: string;
    pid: number;
}

Members

ppid: number;

Parent process id.

name: string;

Name of the process.

pid: number;

Process id.

Kind
interface
Declaration
typings/index.d.ts:4439
types

SignPlaceOption

Interface exported by coc.nvim.

Source

Interface definition

export interface SignPlaceOption {
    id?: number;
    group?: string;
    name: string;
    lnum: number;
    priority?: number;
}

Members

id?: number;

Sign id, auto generated when omitted.

group?: string;

Group of the sign.

name: string;

Name of the defined sign.

lnum: number;

Line number of the sign.

priority?: number;

Priority of the sign.

Kind
interface
Declaration
typings/index.d.ts:4454
types

SignUnplaceOption

Interface exported by coc.nvim.

Source

Interface definition

export interface SignUnplaceOption {
    group?: string;
    id?: number;
}

Members

group?: string;

Sign group, default to the unnamed group.

id?: number;

Sign id, unplace all signs of the group when omitted.

Kind
interface
Declaration
typings/index.d.ts:4477
types

SignPlacedOption

Interface exported by coc.nvim.

Source

Interface definition

export interface SignPlacedOption {
    group?: string;
    id?: number;
    lnum?: number;
}

Members

group?: string;

Use '*' for all group, default to '' as unnamed group.

id?: number;

Sign id.

lnum?: number;

Line number.

Kind
interface
Declaration
typings/index.d.ts:4488
types

SignItem

Interface exported by coc.nvim.

Source

Interface definition

export interface SignItem {
    group: string;
    id: number;
    lnum: number;
    name: string;
    priority: number;
}

Members

group: string;

Group of the sign.

id: number;

Id of the sign.

lnum: number;

Line number of the sign.

name: string;

Name of the sign.

priority: number;

Priority of the sign.

Kind
interface
Declaration
typings/index.d.ts:4503
types

HighlightItem

Interface exported by coc.nvim.

Source

Interface definition

export interface HighlightItem {
    hlGroup: string;
    lnum: number;
    colStart: number;
    colEnd: number;
}

Members

hlGroup: string;

Highlight group name.

lnum: number;

0 based

colStart: number;

0 based

colEnd: number;

0 based

Kind
interface
Declaration
typings/index.d.ts:4526
types

ExtendedHighlightItem

Interface exported by coc.nvim.

Source

Interface definition

export interface ExtendedHighlightItem extends HighlightItem {
    combine?: boolean;
    start_incl?: boolean;
    end_incl?: boolean;
}

Members

combine?: boolean;

Combine the highlight with the existing one.

start_incl?: boolean;

Start column is inclusive.

end_incl?: boolean;

End column is inclusive.

Kind
interface
Declaration
typings/index.d.ts:4545
types

HighlightOption

Interface exported by coc.nvim.

Source

Interface definition

export interface HighlightOption {
    start?: number;
    end?: number;
    priority?: number;
    changedtick?: number;
}

Members

start?: number;

0 based start line, default to 0.

end?: number;

0 based end line, default to 0.

priority?: number;

Default to 0 on vim8, 4096 on neovim

changedtick?: number;

Buffer changedtick to match.

Kind
interface
Declaration
typings/index.d.ts:4560
types

BufferKeymapOption

All values default to false, see :h :map-arguments

Source

Interface definition

export interface BufferKeymapOption {
    desc?: string;
    noremap?: boolean;
    nowait?: boolean;
    silent?: boolean;
    script?: boolean;
    expr?: boolean;
    unique?: boolean;
    special?: boolean;
}

Members

desc?: string;

Description of the keymap.

noremap?: boolean;

Do not remap the keymap.

nowait?: boolean;

Do not wait for more characters.

silent?: boolean;

Do not echo the command.

script?: boolean;

Remap script-local mappings.

expr?: boolean;

The right hand side is an expression.

unique?: boolean;

Fail when the keymap already exists.

special?: boolean;

Allow special characters in the left hand side.

Kind
interface
Declaration
typings/index.d.ts:4582
types

InsertKeymapText

Interface exported by coc.nvim.

Source

Interface definition

export interface InsertKeymapText {
    text: string;
}

Members

text: string;

Literal text to insert.

Kind
interface
Declaration
typings/index.d.ts:4618
types

InsertKeymapKey

Interface exported by coc.nvim.

Source

Interface definition

export interface InsertKeymapKey {
    key: string;
}

Members

key: string;

One special key in Vim key notation, for example <Left> or <C-G>.

Kind
interface
Declaration
typings/index.d.ts:4623
types

InsertKeymapOption

Interface exported by coc.nvim.

Source

Interface definition

export interface InsertKeymapOption {
    buffer?: number | boolean;
    arglist?: string[];
}

Members

buffer?: number | boolean;

Buffer number, or current buffer with true or 0.

arglist?: string[];

Vim expressions evaluated when the mapping is invoked.

Kind
interface
Declaration
typings/index.d.ts:4630
types

BufferHighlight

Interface exported by coc.nvim.

Source

Interface definition

export interface BufferHighlight {
    hlGroup?: string;
    srcId?: number;
    line?: number;
    colStart?: number;
    colEnd?: number;
}

Members

hlGroup?: string;

Name of the highlight group to use

srcId?: number;

Namespace to use or -1 for ungrouped highlight

line?: number;

Line to highlight (zero-indexed)

colStart?: number;

Start of (byte-indexed) column range to highlight

colEnd?: number;

End of (byte-indexed) column range to highlight, or -1 to highlight to end of line

Kind
interface
Declaration
typings/index.d.ts:4637
types

BufferClearHighlight

Interface exported by coc.nvim.

Source

Interface definition

export interface BufferClearHighlight {
    srcId?: number;
    lineStart?: number;
    lineEnd?: number;
}

Members

srcId?: number;

Namespace to clear or -1 for ungrouped highlights.

lineStart?: number;

First line to clear.

lineEnd?: number;

Last line to clear.

Kind
interface
Declaration
typings/index.d.ts:4660
types

VirtualTextOption

Interface exported by coc.nvim.

Source

Interface definition

export interface VirtualTextOption {
    col?: number;
    indent?: boolean;
    hl_mode?: 'combine' | 'replace' | 'blend';
    text_align?: 'after' | 'right' | 'below' | 'above';
    right_gravity?: boolean;
    virt_text_win_col?: number;
    text_wrap?: 'wrap' | 'truncate';
}

Members

col?: number;

Used on vim9 and neovim >= 0.10.0.

indent?: boolean;

Add line indent when text_align is below or above.

hl_mode?: 'combine' | 'replace' | 'blend';

highlight mode, blend is neovim only (replace is used on vim when specified).

text_align?: 'after' | 'right' | 'below' | 'above';

neovim and vim.

right_gravity?: boolean;

neovim only, right_gravity of nvim_buf_set_extmark.

virt_text_win_col?: number;

neovim only

text_wrap?: 'wrap' | 'truncate';

vim9 only

Kind
interface
Declaration
typings/index.d.ts:4675
types

AugroupOption

Interface exported by coc.nvim.

Source

Interface definition

export interface AugroupOption {
    clear?: boolean;
}

Members

clear?: boolean;

Clear the all autocmds before create autocmd group, default to true.

Kind
interface
Declaration
typings/index.d.ts:4706
types

AutocmdOption

Interface exported by coc.nvim.

Source

Interface definition

interface AutocmdOption {
    group?: string | number;
    pattern?: string | string[];
    buffer?: number;
    desc?: string;
    command?: string;
    once?: boolean;
    nested?: boolean;
    replace?: boolean;
}

Members

group?: string | number;

Group name or group id from nvim.createAugroup(), see :h autocmd-groups.

pattern?: string | string[];

Pattern to match, see :h autocmd-pattern.

buffer?: number;

Buffer number for buflocal autocommand, see :h autocmd-buflocal.

desc?: string;

Description test, not used on vim9.

command?: string;

Vim command to run when trigger autocommand.

once?: boolean;

See :h autocmd-once.

nested?: boolean;

See :h autocmd-nested.

replace?: boolean;

Vim9 only, see :h autocmd_add()

Kind
interface
Declaration
typings/index.d.ts:4713
types

BaseApi

Interface exported by coc.nvim.

Source

Interface definition

interface BaseApi<T> {
    id: number;
    equals(other: T): boolean;
    request(name: string, args?: VimValue[]): Promise<any>;
    notify(name: string, args?: VimValue[]): void;
    getVar(name: string): Promise<VimValue | null>;
    setVar(name: string, value: VimValue): Promise<void>;
    setVar(name: string, value: VimValue, isNotify: true): void;
    deleteVar(name: string): void;
    getOption(name: string): Promise<VimValue>;
    setOption(name: string, value: VimValue): Promise<void>;
    setOption(name: string, value: VimValue, isNotify: true): void;
}

Members

id: number;

unique identify number

equals(other: T): boolean;

Check if same by compare id.

request(name: string, args?: VimValue[]): Promise<any>;

Request to vim, name need to be nvim_ prefixed and supported by vim.

notify(name: string, args?: VimValue[]): void;

Send notification to vim, name need to be nvim_ prefixed and supported by vim

getVar(name: string): Promise<VimValue | null>;

Retrieves scoped variable, returns null when value doesn't exist.

setVar(name: string, value: VimValue): Promise<void>;

Set scoped variable by request.

setVar(name: string, value: VimValue, isNotify: true): void;

Set scoped variable by notification.

deleteVar(name: string): void;

Delete scoped variable by notification.

getOption(name: string): Promise<VimValue>;

Retrieves a scoped option, doesn't exist for tabpage.

Note: neovim returns true/false for boolean option, but it would be 0/1 on vim.

setOption(name: string, value: VimValue): Promise<void>;

Set scoped option by request, doesn't exist for tabpage.

setOption(name: string, value: VimValue, isNotify: true): void;

Set scoped variable by notification, doesn't exist for tabpage.

Kind
interface
Declaration
typings/index.d.ts:4748
types

Neovim

Interface exported by coc.nvim.

Source

Interface definition

export interface Neovim extends BaseApi<Neovim> {
    echoError(error: Error | string): void;
    hasFunction(name: string): boolean;
    channelId: Promise<number>;
    createBuffer(id: number): Buffer;
    createWindow(id: number): Window;
    createTabpage(id: number): Tabpage;
    pauseNotification(): void;
    resumeNotification(redrawVim?: boolean): Promise<[
        VimValue[],
        [
            string,
            number,
            string
        ] | null
    ]>;
    resumeNotification(redrawVim: boolean, notify: true): void;
    redrawVim(): void;
    buffers: Promise<Buffer[]>;
    buffer: Promise<Buffer>;
    setBuffer(buffer: Buffer): Promise<void>;
    tabpages: Promise<Tabpage[]>;
    tabpage: Promise<Tabpage>;
    setTabpage(tabpage: Tabpage): Promise<void>;
    windows: Promise<Window[]>;
    window: Promise<Window>;
    setWindow(window: Window): Promise<void>;
    chans: Promise<ChanInfo[]>;
    getChanInfo(id: number): Promise<ChanInfo>;
    createNamespace(name?: string): Promise<number>;
    namespaces: Promise<{
        [name: string]: number;
    }>;
    getCommands(opt?: {
        builtin: boolean;
    }): Promise<{
        [name: string]: VimCommandDescription;
    }>;
    runtimePaths: Promise<string[]>;
    setDirectory(dir: string): Promise<void>;
    line: Promise<string>;
    createNewBuffer(listed?: boolean, scratch?: boolean): Promise<Buffer>;
    openFloatWindow(buffer: Buffer, enter: boolean, options: NvimFloatOptions): Promise<Window>;
    setLine(line: string): Promise<void>;
    getKeymap(mode: string): Promise<object[]>;
    mode: Promise<{
        mode: string;
        blocking: boolean;
    }>;
    colorMap(): Promise<{
        [name: string]: number;
    }>;
    getColorByName(name: string): Promise<number>;
    getHighlight(nameOrId: string | number, isRgb?: boolean): Promise<object>;
    getHighlightByName(name: string, isRgb?: boolean): Promise<object>;
    getHighlightById(id: number, isRgb?: boolean): Promise<object>;
    deleteCurrentLine(): Promise<void>;
    eval(expr: string): Promise<VimValue>;
    lua(code: string, args?: VimValue[]): Promise<object>;
    callDictFunction(dict: object | string, fname: string, args: VimValue | VimValue[]): Promise<object>;
    call(fname: string, args?: VimValue | VimValue[]): Promise<unknown>;
    call(fname: string, args: VimValue | VimValue[], isNotify: true): void;
    callVim(fname: string, args?: VimValue | VimValue[]): Promise<unknown>;
    callVim(fname: string, args: VimValue | VimValue[], isNotify: true): void;
    evalVim(expr: string): Promise<unknown>;
    exVim(command: string): void;
    callTimer(fname: string, args?: VimValue | VimValue[]): Promise<void>;
    callTimer(fname: string, args: VimValue | VimValue[], isNotify: true): void;
    callAsync(fname: string, args?: VimValue | VimValue[]): Promise<unknown>;
    callAtomic(calls: [
        string,
        VimValue[]
    ][]): Promise<[
        any[],
        any[] | null
    ]>;
    command(arg: string): Promise<void>;
    command(arg: string, isNotify: true): void;
    commandOutput(arg: string): Promise<string>;
    exec(src: string, output?: boolean): Promise<string>;
    getVvar(name: string): Promise<VimValue>;
    feedKeys(keys: string, mode: string, escapeCsi: boolean): Promise<void>;
    setKeymap(mode: string, lhs: string, rhs: string, opts?: BufferKeymapOption): void;
    deleteKeymap(mode: string, lhs: string): void;
    input(keys: string): Promise<number>;
    parseExpression(expr: string, flags: string, highlight: boolean): Promise<object>;
    getProc(pid: number): Promise<NvimProc>;
    getProcChildren(pid: number): Promise<NvimProc[]>;
    replaceTermcodes(str: string, fromPart: boolean, doIt: boolean, special: boolean): Promise<string>;
    strWidth(str: string): Promise<number>;
    createAugroup(name: string, option?: AugroupOption): Promise<number>;
    createAugroup(name: string, option: AugroupOption, isNotify: true): void;
    createAutocmd(event: string | string[], option?: AutocmdOption): Promise<number>;
    createAutocmd(event: string | string[], option: AutocmdOption, isNotify: true): void;
    deleteAutocmd(id: number): void;
    uis: Promise<any[]>;
    subscribe(event: string): Promise<void>;
    unsubscribe(event: string): Promise<void>;
    quit(): Promise<void>;
}

Members

echoError(error: Error | string): void;

Echo error message to vim and log error stack.

hasFunction(name: string): boolean;

Check if nvim_ function exists.

channelId: Promise<number>;

Get channelid used by coc.nvim.

createBuffer(id: number): Buffer;

Create buffer instance by id.

createWindow(id: number): Window;

Create window instance by id.

createTabpage(id: number): Tabpage;

Create tabpage instance by id.

pauseNotification(): void;

Stop send subsequent notifications. This method must be paired with nvim.resumeNotification in a sync manner.

resumeNotification(redrawVim?: boolean): Promise<[ VimValue[], [ string, number, string ] | null ]>;

Send paused notifications by nvim_call_atomic request

resumeNotification(redrawVim: boolean, notify: true): void;

Send paused notifications by nvim_call_atomic notification

redrawVim(): void;

Send redraw command to vim, does nothing on neovim since it's not necessary on most cases.

buffers: Promise<Buffer[]>;

Get list of current buffers.

buffer: Promise<Buffer>;

Get current buffer.

setBuffer(buffer: Buffer): Promise<void>;

Set current buffer

tabpages: Promise<Tabpage[]>;

Get list of current tabpages.

tabpage: Promise<Tabpage>;

Get current tabpage.

setTabpage(tabpage: Tabpage): Promise<void>;

Set current tabpage

windows: Promise<Window[]>;

Get list of current windows.

window: Promise<Window>;

Get current window.

setWindow(window: Window): Promise<void>;

Set current window.

chans: Promise<ChanInfo[]>;

Get information of all channels, Note: works on neovim only.

getChanInfo(id: number): Promise<ChanInfo>;

Get information of channel by id, Note: works on neovim only.

createNamespace(name?: string): Promise<number>;

Creates a new namespace, or gets an existing one. :h nvim_create_namespace()

namespaces: Promise<{ [name: string]: number; }>;

Gets existing, non-anonymous namespaces. Note: works on neovim only.

getCommands(opt?: { builtin: boolean; }): Promise<{ [name: string]: VimCommandDescription; }>;

Gets a map of global (non-buffer-local) Ex commands.

runtimePaths: Promise<string[]>;

Get list of all runtime paths

setDirectory(dir: string): Promise<void>;

Set global working directory. Note: works on neovim only.

line: Promise<string>;

Get current line.

createNewBuffer(listed?: boolean, scratch?: boolean): Promise<Buffer>;

Creates a new, empty, unnamed buffer.

openFloatWindow(buffer: Buffer, enter: boolean, options: NvimFloatOptions): Promise<Window>;

Create float window of neovim.

Note: works on neovim only, use high level api provided by window module is recommended.

setLine(line: string): Promise<void>;

Set current line.

getKeymap(mode: string): Promise<object[]>;

Gets a list of global (non-buffer-local) |mapping| definitions. :h nvim_get_keymap

Note: works on neovim only.

mode: Promise<{ mode: string; blocking: boolean; }>;

Gets the current mode. |mode()| "blocking" is true if Nvim is waiting for input.

Note: blocking would always be false when used with vim.

colorMap(): Promise<{ [name: string]: number; }>;

Returns a map of color names and RGB values.

Note: works on neovim only.

getColorByName(name: string): Promise<number>;

Returns the 24-bit RGB value of a |nvim_get_color_map()| color name or "#rrggbb" hexadecimal string.

Note: works on neovim only.

getHighlight(nameOrId: string | number, isRgb?: boolean): Promise<object>;

Gets a highlight definition by id. |hlID()|

Note: works on neovim only.

getHighlightByName(name: string, isRgb?: boolean): Promise<object>;

Get a highlight by name, return rgb by default.

Note: works on neovim only.

getHighlightById(id: number, isRgb?: boolean): Promise<object>;

Get a highlight by id, return rgb by default.

Note: works on neovim only.

deleteCurrentLine(): Promise<void>;

Delete current line in buffer.

eval(expr: string): Promise<VimValue>;

Evaluates a VimL expression (:help expression). Dictionaries and Lists are recursively expanded. On VimL error: Returns a generic error; v:errmsg is not updated.

lua(code: string, args?: VimValue[]): Promise<object>;

Executes lua, it's possible neovim client does not support this

Note: works on neovim only.

callDictFunction(dict: object | string, fname: string, args: VimValue | VimValue[]): Promise<object>;

Calls a VimL |Dictionary-function| with the given arguments.

call(fname: string, args?: VimValue | VimValue[]): Promise<unknown>;

Call a vim function.

call(fname: string, args: VimValue | VimValue[], isNotify: true): void;

Call a vim function by notification.

callVim(fname: string, args?: VimValue | VimValue[]): Promise<unknown>;

Use call command :h channel-commands to call function on vim9. Warning: NodeJS side only get the 'ERROR' text on error, to get error message, see :h coc-api-channel

callVim(fname: string, args: VimValue | VimValue[], isNotify: true): void;

Use call command :h channel-commands to call function on vim9. Warning: errors not exists on NodeJS side, see :h coc-api-channel

evalVim(expr: string): Promise<unknown>;

Use expr command :h channel-commands to eval expression on vim9. Warning: NodeJS side only get the 'ERROR' text on error, to get error message, see :h coc-api-channel

exVim(command: string): void;

Use ex command :h channel-commands to execute command on vim9. Warning: errors not exists on NodeJS side, see :h coc-api-channel

callTimer(fname: string, args?: VimValue | VimValue[]): Promise<void>;

Call a vim function with timer of timeout 0.

callTimer(fname: string, args: VimValue | VimValue[], isNotify: true): void;

Call a vim function with timer of timeout 0 by notification.

callAsync(fname: string, args?: VimValue | VimValue[]): Promise<unknown>;

Call async vim function that accept callback as argument by using notifications.

callAtomic(calls: [ string, VimValue[] ][]): Promise<[ any[], any[] | null ]>;

Calls many API methods atomically.

command(arg: string): Promise<void>;

Executes an ex-command by request.

command(arg: string, isNotify: true): void;

Executes an ex-command by notification.

commandOutput(arg: string): Promise<string>;

Runs a command and returns output.

exec(src: string, output?: boolean): Promise<string>;

Executes Vimscript (multiline block of Ex-commands), like anonymous |:source|

getVvar(name: string): Promise<VimValue>;

Gets a v: variable.

feedKeys(keys: string, mode: string, escapeCsi: boolean): Promise<void>;

:h nvim_feedkeys

setKeymap(mode: string, lhs: string, rhs: string, opts?: BufferKeymapOption): void;

Add global keymap by notification, :h nvim_set_keymap

deleteKeymap(mode: string, lhs: string): void;

Delete global keymap, :h nvim_del_keymap

input(keys: string): Promise<number>;

Queues raw user-input. Unlike |nvim_feedkeys()|, this uses a low-level input buffer and the call is non-blocking (input is processed asynchronously by the eventloop).

On execution error: does not fail, but updates v:errmsg.

Note: works on neovim only.

parseExpression(expr: string, flags: string, highlight: boolean): Promise<object>;

Parse a VimL Expression.

getProc(pid: number): Promise<NvimProc>;

Get process info, neovim only.

Note: works on neovim only.

getProcChildren(pid: number): Promise<NvimProc[]>;

Gets the immediate children of process pid.

Note: works on neovim only.

replaceTermcodes(str: string, fromPart: boolean, doIt: boolean, special: boolean): Promise<string>;

Replaces terminal codes and |keycodes| (<CR>, <Esc>, ...) in a string with the internal representation.

Note: works on neovim only.

strWidth(str: string): Promise<number>;

Gets width(display cells) of string.

createAugroup(name: string, option?: AugroupOption): Promise<number>;

Create autocmd group with {name} and {option}

createAugroup(name: string, option: AugroupOption, isNotify: true): void;

Create autocmd group with {name} and {option}, use notification to vim.

createAutocmd(event: string | string[], option?: AutocmdOption): Promise<number>;

Create autocmd with {event} and {option}

createAutocmd(event: string | string[], option: AutocmdOption, isNotify: true): void;

Create autocmd with {event} and {option}

deleteAutocmd(id: number): void;

Delete autocmd with {id} returned from nvim.createAutocmd() Notice: vim9 can't support delete specific autocmd yet, autocmds which have the same group event pattern are all cleared.

uis: Promise<any[]>;

Gets a list of dictionaries representing attached UIs.

Note: works on neovim only.

subscribe(event: string): Promise<void>;

Subscribe to nvim event broadcasts.

Note: works on neovim only.

unsubscribe(event: string): Promise<void>;

Unsubscribe to nvim event broadcasts

Note: works on neovim only.

quit(): Promise<void>;

Quit vim.

Kind
interface
Declaration
typings/index.d.ts:4819
types

Buffer

Interface exported by coc.nvim.

Source

Interface definition

export interface Buffer extends BaseApi<Buffer> {
    id: number;
    length: Promise<number>;
    lines: Promise<string[]>;
    changedtick: Promise<number>;
    setKeymap(mode: string, lhs: string, rhs: string, opts?: BufferKeymapOption): void;
    deleteKeymap(mode: string, lhs: string): void;
    deleteExtMark(ns_id: number, id: number): void;
    getExtMarkById(ns_id: number, id: number, opts?: {
        details?: boolean;
    }): Promise<[
    ] | [
        number,
        number
    ] | [
        number,
        number,
        ExtmarkDetails
    ]>;
    getExtMarks(ns_id: number, start: [
        number,
        number
    ] | number, end: [
        number,
        number
    ] | number, opts?: {
        details?: boolean;
        limit?: number;
    }): Promise<[
        number,
        number,
        number,
        ExtmarkDetails?
    ][]>;
    setExtMark(ns_id: number, line: number, col: number, opts?: ExtmarkOptions): void;
    placeSign(sign: SignPlaceOption): void;
    unplaceSign(opts: SignUnplaceOption): void;
    getSigns(opts: SignPlacedOption): Promise<SignItem[]>;
    getHighlights(ns: string, start?: number, end?: number): Promise<HighlightItem[]>;
    updateHighlights(ns: string, highlights: ExtendedHighlightItem[], opts?: HighlightOption): void;
    getCommands(options?: {}): Promise<Object>;
    getLines(opts?: {
        start: number;
        end: number;
        strictIndexing?: boolean;
    }): Promise<string[]>;
    setLines(lines: string[], opts?: {
        start: number;
        end: number;
        strictIndexing?: boolean;
    }): Promise<void>;
    setLines(lines: string[], opts: {
        start: number;
        end: number;
        strictIndexing?: boolean;
    }, isNotify: true): void;
    setVirtualText(src_id: number, line: number, chunks: [
        string,
        string
    ][], opts?: VirtualTextOption): void;
    append(lines: string[] | string): Promise<void>;
    name: Promise<string>;
    setName(name: string): Promise<void>;
    valid: Promise<boolean>;
    mark(name: string): Promise<[
        number,
        number
    ]>;
    getKeymap(mode: string): Promise<object[]>;
    loaded: Promise<boolean>;
    getOffset(index: number): Promise<number>;
    addHighlight(opts: BufferHighlight): Promise<number | null>;
    clearHighlight(args?: BufferClearHighlight): void;
    highlightRanges(srcId: string | number, hlGroup: string, ranges: Range[]): void;
    clearNamespace(key: number | string, lineStart?: number, lineEnd?: number): void;
}

Members

id: number;

Buffer number.

length: Promise<number>;

Total number of lines in buffer

lines: Promise<string[]>;

Get lines of buffer.

changedtick: Promise<number>;

Get changedtick of buffer.

setKeymap(mode: string, lhs: string, rhs: string, opts?: BufferKeymapOption): void;

Add buffer keymap by notification, :h nvim_buf_set_keymap

deleteKeymap(mode: string, lhs: string): void;

Delete buffer keymap, :h nvim_buf_del_keymap

deleteExtMark(ns_id: number, id: number): void;

Removes an ext mark by notification. Neovim only.

getExtMarkById(ns_id: number, id: number, opts?: { details?: boolean; }): Promise<[ ] | [ number, number ] | [ number, number, ExtmarkDetails ]>;

Gets the position (0-indexed) of an extmark. Neovim only.

getExtMarks(ns_id: number, start: [ number, number ] | number, end: [ number, number ] | number, opts?: { details?: boolean; limit?: number; }): Promise<[ number, number, number, ExtmarkDetails? ][]>;

Gets extmarks in "traversal order" from a |charwise| region defined by buffer positions (inclusive, 0-indexed |api-indexing|).

Region can be given as (row,col) tuples, or valid extmark ids (whose positions define the bounds). 0 and -1 are understood as (0,0) and (-1,-1) respectively, thus the following are equivalent:

nvim_buf_get_extmarks(0, my_ns, 0, -1, {})
nvim_buf_get_extmarks(0, my_ns, [0,0], [-1,-1], {})
setExtMark(ns_id: number, line: number, col: number, opts?: ExtmarkOptions): void;

Creates or updates an extmark by notification, :h nvim_buf_set_extmark.

placeSign(sign: SignPlaceOption): void;

Add sign to buffer by notification.

unplaceSign(opts: SignUnplaceOption): void;

Unplace signs by notification

getSigns(opts: SignPlacedOption): Promise<SignItem[]>;

Get signs by group name or id and lnum.

getHighlights(ns: string, start?: number, end?: number): Promise<HighlightItem[]>;

Get highlight items by namespace (end inclusive).

updateHighlights(ns: string, highlights: ExtendedHighlightItem[], opts?: HighlightOption): void;

Update namespaced highlights in range by notification. Priority default to 0 on vim and 4096 on neovim. Note: timer used for whole buffer highlights for better performance.

getCommands(options?: {}): Promise<Object>;

Gets a map of buffer-local |user-commands|.

Note: works on neovim only.

getLines(opts?: { start: number; end: number; strictIndexing?: boolean; }): Promise<string[]>;

Get lines of buffer, get all lines by default.

setLines(lines: string[], opts?: { start: number; end: number; strictIndexing?: boolean; }): Promise<void>;

Set lines of buffer given indices use request.

setLines(lines: string[], opts: { start: number; end: number; strictIndexing?: boolean; }, isNotify: true): void;

Set lines of buffer given indices use notification.

setVirtualText(src_id: number, line: number, chunks: [ string, string ][], opts?: VirtualTextOption): void;

Set virtual text for a line use notification, works on both neovim and vim9.

append(lines: string[] | string): Promise<void>;

Append a string or list of lines to end of buffer

name: Promise<string>;

Get buffer name.

setName(name: string): Promise<void>;

Set buffer name.

valid: Promise<boolean>;

Check if buffer valid.

mark(name: string): Promise<[ number, number ]>;

Get mark position given mark name

Note: works on neovim only.

getKeymap(mode: string): Promise<object[]>;

Gets a list of buffer-local |mapping| definitions.

loaded: Promise<boolean>;

Check if buffer loaded.

getOffset(index: number): Promise<number>;

Returns the byte offset for a line.

Line 1 (index=0) has offset 0. UTF-8 bytes are counted. EOL is one byte. 'fileformat' and 'fileencoding' are ignored. The line index just after the last line gives the total byte-count of the buffer. A final EOL byte is counted if it would be written, see 'eol'.

Unlike |line2byte()|, throws error for out-of-bounds indexing. Returns -1 for unloaded buffer.

addHighlight(opts: BufferHighlight): Promise<number | null>;

Adds a highlight to buffer, checkout |nvim_buf_add_highlight|.

Note: when srcId = 0, request is made for new srcId, otherwire, use notification. Note: hlGroup as empty string is not supported.

clearHighlight(args?: BufferClearHighlight): void;

Clear highlights of specified lines.

highlightRanges(srcId: string | number, hlGroup: string, ranges: Range[]): void;

Add highlight to ranges by notification, works on both vim & neovim.

Works on neovim and workspace.isVim && workspace.env.textprop is true

clearNamespace(key: number | string, lineStart?: number, lineEnd?: number): void;

Clear namespace by id or name by notification, works on both vim & neovim.

Works on neovim and workspace.isVim && workspace.env.textprop is true

Kind
interface
Declaration
typings/index.d.ts:5275
types

Window

Interface exported by coc.nvim.

Source

Interface definition

export interface Window extends BaseApi<Window> {
    id: number;
    buffer: Promise<Buffer>;
    tabpage: Promise<Tabpage>;
    cursor: Promise<[
        number,
        number
    ]>;
    height: Promise<number>;
    width: Promise<number>;
    setCursor(pos: [
        number,
        number
    ]): Promise<void>;
    setCursor(pos: [
        number,
        number
    ], isNotify: true): void;
    setHeight(height: number): Promise<void>;
    setHeight(height: number, isNotify: true): void;
    setWidth(width: number): Promise<void>;
    setWidth(width: number, isNotify: true): void;
    position: Promise<[
        number,
        number
    ]>;
    row: Promise<number>;
    col: Promise<number>;
    valid: Promise<boolean>;
    number: Promise<number>;
    setConfig(options: NvimFloatOptions): Promise<void>;
    setConfig(options: NvimFloatOptions, isNotify: true): void;
    getConfig(): Promise<NvimFloatOptions>;
    close(force: boolean): Promise<void>;
    close(force: boolean, isNotify: true): void;
    highlightRanges(hlGroup: string, ranges: Range[], priority?: number): Promise<number[]>;
    highlightRanges(hlGroup: string, ranges: Range[], priority: number, isNotify: true): void;
    clearMatchGroup(hlGroup: string): void;
    clearMatches(ids: number[]): void;
}

Members

id: number;

The windowid that not change within a Vim session

buffer: Promise<Buffer>;

Buffer in window.

tabpage: Promise<Tabpage>;

Tabpage contains window.

cursor: Promise<[ number, number ]>;

Cursor position as [line, col], 1 based.

height: Promise<number>;

Window height.

width: Promise<number>;

Window width.

setCursor(pos: [ number, number ]): Promise<void>;

Set cursor position by request.

setCursor(pos: [ number, number ], isNotify: true): void;

Set cursor position by notification.

setHeight(height: number): Promise<void>;

Set height

setHeight(height: number, isNotify: true): void;

Set height by notification.

setWidth(width: number): Promise<void>;

Set width.

setWidth(width: number, isNotify: true): void;

Set width by notification.

position: Promise<[ number, number ]>;

Get window position, not work with vim8's popup.

row: Promise<number>;

0-indexed, on-screen window position(row) in display cells.

col: Promise<number>;

0-indexed, on-screen window position(col) in display cells.

valid: Promise<boolean>;

Check if window valid.

number: Promise<number>;

Get window number, throws for invalid window.

setConfig(options: NvimFloatOptions): Promise<void>;

Config float window with options.

Note: works on neovim only.

setConfig(options: NvimFloatOptions, isNotify: true): void;

Config float window with options by send notification.

Note: works on neovim only.

getConfig(): Promise<NvimFloatOptions>;

Gets window configuration.

Note: works on neovim only.

close(force: boolean): Promise<void>;

Close window by send request.

close(force: boolean, isNotify: true): void;

Close window by send notification.

highlightRanges(hlGroup: string, ranges: Range[], priority?: number): Promise<number[]>;

Add highlight to ranges by request (matchaddpos is used)

highlightRanges(hlGroup: string, ranges: Range[], priority: number, isNotify: true): void;

Add highlight to ranges by notification (matchaddpos is used)

clearMatchGroup(hlGroup: string): void;

Clear match of highlight group by send notification.

clearMatches(ids: number[]): void;

Clear match of match ids by send notification.

Kind
interface
Declaration
typings/index.d.ts:5527
types

Tabpage

Interface exported by coc.nvim.

Source

Interface definition

export interface Tabpage extends BaseApi<Tabpage> {
    number: Promise<number>;
    valid: Promise<boolean>;
    windows: Promise<Window[]>;
    window: Promise<Window>;
}

Members

number: Promise<number>;

tabpage number.

valid: Promise<boolean>;

Is current tabpage valid.

windows: Promise<Window[]>;

Returns all windows of tabpage.

window: Promise<Window>;

Current window of tabpage.

Kind
interface
Declaration
typings/index.d.ts:5665
types

UriComponents

Interface exported by coc.nvim.

Source

Interface definition

export interface UriComponents {
    scheme: string;
    authority: string;
    path: string;
    query: string;
    fragment: string;
}

Members

scheme: string;

The scheme of the URI, e.g. file.

authority: string;

The authority of the URI.

path: string;

The path of the URI.

query: string;

The query of the URI.

fragment: string;

The fragment of the URI.

Kind
interface
Declaration
typings/index.d.ts:5689
types

Uri

Uniform Resource Identifier (URI) RFC 3986. This class is a simple parser which creates the basic component parts (RFC 3986) with minimal validation and encoding.

      foo://example.com:8042/over/there?name=ferret#nose
      \_/   \______________/\_________/ \_________/ \__/
       |           |            |            |        |
    scheme     authority       path        query   fragment
       |   _____________________|__
      / \ /                        \
      urn:example:animal:ferret:nose
Source

Class definition

export class Uri implements UriComponents {
    static isUri(thing: any): thing is Uri;
    readonly scheme: string;
    readonly authority: string;
    readonly path: string;
    readonly query: string;
    readonly fragment: string;
    protected constructor(scheme: string, authority?: string, path?: string, query?: string, fragment?: string, _strict?: boolean);
    protected constructor(components: UriComponents);
    readonly fsPath: string;
    with(change: {
        scheme?: string;
        authority?: string | null;
        path?: string | null;
        query?: string | null;
        fragment?: string | null;
    }): Uri;
    static parse(value: string, _strict?: boolean): Uri;
    static file(path: string): Uri;
    static from(components: {
        scheme: string;
        authority?: string;
        path?: string;
        query?: string;
        fragment?: string;
    }): Uri;
    toString(skipEncoding?: boolean): string;
    toJSON(): UriComponents;
}

Members

static isUri(thing: any): thing is Uri;

Checks whether the given value is a URI.

readonly scheme: string;

scheme is the 'http' part of 'msft.com reference'. The part before the first colon.

readonly authority: string;

authority is the 'www.msft.com' part of 'msft.com reference'. The part between the first double slashes and the next slash.

readonly path: string;

path is the '/some/path' part of 'msft.com reference'.

readonly query: string;

query is the 'query' part of 'msft.com reference'.

readonly fragment: string;

fragment is the 'fragment' part of 'msft.com reference'.

protected constructor(scheme: string, authority?: string, path?: string, query?: string, fragment?: string, _strict?: boolean);
protected constructor(components: UriComponents);
readonly fsPath: string;

Returns a string representing the corresponding file system path of this URI. Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the platform specific path separator.

  • Will not validate the path for invalid characters and semantics.
  • Will not look at the scheme of this URI.
  • The result shall not be used for display purposes but for accessing a file on disk.

The difference to URI#path is the use of the platform specific separator and the handling of UNC paths. See the below sample of a file-uri with an authority (UNC path).

     const u = URI.parse('file://server/c$/folder/file.txt')
     u.authority === 'server'
     u.path === '/shares/c$/file.txt'
     u.fsPath === '\\server\c$\folder\file.txt'

Using URI#path to read a file (using fs-apis) would not be enough because parts of the path, namely the server name, would be missing. Therefore URI#fsPath exists - it's sugar to ease working with URIs that represent files on disk (file scheme).

with(change: { scheme?: string; authority?: string | null; path?: string | null; query?: string | null; fragment?: string | null; }): Uri;

Returns a new URI with the changed components.

static parse(value: string, _strict?: boolean): Uri;

Creates a new URI from a string, e.g. http://www.msft.com/some/path, file:///usr/home, or scheme:with/path.

static file(path: string): Uri;

Creates a new URI from a file system path, e.g. c:\my\files, /usr/home, or \\server\share\some\path.

The difference between URI#parse and URI#file is that the latter treats the argument as path, not as stringified-uri. E.g. URI.file(path) is not the same as URI.parse('file://' + path) because the path might contain characters that are interpreted (# and ?). See the following sample:

 const good = URI.file('/coding/c#/project1');
 good.scheme === 'file';
 good.path === '/coding/c#/project1';
 good.fragment === '';
 const bad = URI.parse('file://' + '/coding/c#/project1');
 bad.scheme === 'file';
 bad.path === '/coding/c'; // path is now broken
 bad.fragment === '/project1';
static from(components: { scheme: string; authority?: string; path?: string; query?: string; fragment?: string; }): Uri;

Creates a new URI from its components.

toString(skipEncoding?: boolean): string;

Creates a string representation for this URI. It's guaranteed that calling URI.parse with the result of this function creates an URI which is equal to this URI.

  • The result shall not be used for display purposes but for externalization or transport.
  • The result will be encoded using the percentage encoding and encoding happens mostly ignore the scheme-specific encoding rules.
toJSON(): UriComponents;

Serialize the URI to its components.

Kind
class
Declaration
typings/index.d.ts:5727
types

VimCompleteItem

See :h complete-items

Source

Interface definition

export interface VimCompleteItem {
    word: string;
    abbr?: string;
    menu?: string;
    info?: string;
    kind?: string;
    icase?: number;
    equal?: number;
    dup?: number;
    empty?: number;
    user_data?: string;
    deprecated?: boolean;
    labelDetails?: CompletionItemLabelDetails;
    sortText?: string;
    filterText?: string;
    insertText?: string;
    isSnippet?: boolean;
    documentation?: Documentation[];
}

Members

word: string;

The word to be inserted.

abbr?: string;

Abbreviated word shown in the menu.

menu?: string;

Description shown in the menu.

info?: string;
kind?: string;

Kind of the item.

icase?: number;

Ignore case when comparing.

equal?: number;

Match when the word is equal.

dup?: number;

Duplicate the item in the list.

empty?: number;

Accept an empty word.

user_data?: string;

Custom data of the item.

deprecated?: boolean;

The same as deprecated tag.

labelDetails?: CompletionItemLabelDetails;

Additional details for a completion item label.

sortText?: string;

A string that should be used when comparing this item with other items. When falsy the word is used.

filterText?: string;

A string that should be used when filtering a set of completion items. When falsy the word is used.

insertText?: string;

Text to insert, could be snippet text.

isSnippet?: boolean;

When true and onCompleteDone handler not exists on source, the snippet would be expanded after confirm completion.

documentation?: Documentation[];

Docs to shown in detail window.

Kind
interface
Declaration
typings/index.d.ts:5863
types

CompleteDoneItem

Interface exported by coc.nvim.

Source

Interface definition

export interface CompleteDoneItem {
    readonly word: string;
    readonly abbr?: string;
    readonly source: string;
    readonly isSnippet: boolean;
    readonly kind?: string | CompletionItemKind;
    readonly menu?: string;
}

Members

readonly word: string;

The word of the completed item.

readonly abbr?: string;

Abbreviated word of the item.

readonly source: string;

Name of the completion source.

readonly isSnippet: boolean;

Whether the item is a snippet.

readonly kind?: string | CompletionItemKind;

Kind of the item.

readonly menu?: string;

Description shown in the menu.

Kind
interface
Declaration
typings/index.d.ts:5939
types

LocationListItem

Interface exported by coc.nvim.

Source

Interface definition

export interface LocationListItem {
    bufnr: number;
    lnum: number;
    end_lnum: number;
    col: number;
    end_col: number;
    text: string;
    type: string;
}

Members

bufnr: number;

Buffer number of the item.

lnum: number;

Start line, 1 based.

end_lnum: number;

End line, 1 based.

col: number;

Start column, 1 based.

end_col: number;

End column, 1 based.

text: string;

Text of the line.

type: string;

Type of the item, like E, W or I.

Kind
interface
Declaration
typings/index.d.ts:5966
types

QuickfixItem

Interface exported by coc.nvim.

Source

Interface definition

export interface QuickfixItem {
    uri?: string;
    module?: string;
    range?: Range;
    text?: string;
    type?: string;
    filename?: string;
    bufnr?: number;
    lnum?: number;
    end_lnum?: number;
    col?: number;
    end_col?: number;
    valid?: boolean;
    nr?: number;
}

Members

uri?: string;

Uri of the file.

module?: string;

Module name of the item.

range?: Range;

Range of the item.

text?: string;

Text of the item.

type?: string;

Type of the item.

filename?: string;

Filename of the item.

bufnr?: number;

Buffer number of the item.

lnum?: number;

Start line, 1 based.

end_lnum?: number;

End line, 1 based.

col?: number;

Start column, 1 based.

end_col?: number;

End column, 1 based.

valid?: boolean;

Whether the item is valid.

nr?: number;

Number of the item.

Kind
interface
Declaration
typings/index.d.ts:5997
types

ProviderResult

A provider result represents the values a provider, like the HoverProvider, may return. For once this is the actual result type T, like Hover, or a thenable that resolves to that type T. In addition, null and undefined can be returned - either directly or from a thenable.

The snippets below are all valid implementations of the HoverProvider:

let a: HoverProvider = {
  provideHover(doc, pos, token): ProviderResult<Hover> {
    return new Hover('Hello World')
  }
}

let b: HoverProvider = {
  provideHover(doc, pos, token): ProviderResult<Hover> {
    return new Promise(resolve => {
      resolve(new Hover('Hello World'))
     })
  }
}

let c: HoverProvider = {
  provideHover(doc, pos, token): ProviderResult<Hover> {
    return; // undefined
  }
}
Source

Type definition

export type ProviderResult<T> = T | undefined | null | Thenable<T | undefined | null>;
Kind
type alias
Declaration
typings/index.d.ts:6084
types

ProviderName

Supported provider names.

Source

Enum definition

export enum ProviderName {
    FormatOnType = 'formatOnType',
    Rename = 'rename',
    OnTypeEdit = 'onTypeEdit',
    DocumentLink = 'documentLink',
    DocumentColor = 'documentColor',
    FoldingRange = 'foldingRange',
    Format = 'format',
    CodeAction = 'codeAction',
    FormatRange = 'formatRange',
    Hover = 'hover',
    Signature = 'signature',
    WorkspaceSymbols = 'workspaceSymbols',
    DocumentSymbol = 'documentSymbol',
    DocumentHighlight = 'documentHighlight',
    Definition = 'definition',
    Declaration = 'declaration',
    TypeDefinition = 'typeDefinition',
    Reference = 'reference',
    Implementation = 'implementation',
    CodeLens = 'codeLens',
    SelectionRange = 'selectionRange',
    CallHierarchy = 'callHierarchy',
    SemanticTokens = 'semanticTokens',
    SemanticTokensRange = 'semanticTokensRange',
    LinkedEditing = 'linkedEditing',
    InlayHint = 'inlayHint',
    InlineValue = 'inlineValue',
    InlineCompletion = 'inlineCompletion',
    NextEdit = 'nextEdit',
    TypeHierarchy = 'typeHierarchy'
}

Members

FormatOnType = 'formatOnType'
Rename = 'rename'
OnTypeEdit = 'onTypeEdit'
DocumentLink = 'documentLink'
DocumentColor = 'documentColor'
FoldingRange = 'foldingRange'
Format = 'format'
CodeAction = 'codeAction'
FormatRange = 'formatRange'
Hover = 'hover'
Signature = 'signature'
WorkspaceSymbols = 'workspaceSymbols'
DocumentSymbol = 'documentSymbol'
DocumentHighlight = 'documentHighlight'
Definition = 'definition'
Declaration = 'declaration'
TypeDefinition = 'typeDefinition'
Reference = 'reference'
Implementation = 'implementation'
CodeLens = 'codeLens'
SelectionRange = 'selectionRange'
CallHierarchy = 'callHierarchy'
SemanticTokens = 'semanticTokens'
SemanticTokensRange = 'semanticTokensRange'
LinkedEditing = 'linkedEditing'
InlayHint = 'inlayHint'
InlineValue = 'inlineValue'
InlineCompletion = 'inlineCompletion'
NextEdit = 'nextEdit'
TypeHierarchy = 'typeHierarchy'
Kind
enum
Declaration
typings/index.d.ts:6093
types

CompletionItemProvider

The completion item provider interface defines the contract between extensions and IntelliSense.

Providers can delay the computation of the detail and documentation properties by implementing the resolveCompletionItem-function. However, properties that are needed for the initial sorting and filtering, like sortText, filterText, insertText, and range, must not be changed during resolve.

Providers are asked for completions either explicitly by a user gesture or -depending on the configuration- implicitly when typing words or trigger characters.

Source

Interface definition

export interface CompletionItemProvider {
    provideCompletionItems(document: LinesTextDocument, position: Position, token: CancellationToken, context?: CompletionContext): ProviderResult<CompletionItem[] | CompletionList>;
    resolveCompletionItem?(item: CompletionItem, token: CancellationToken): ProviderResult<CompletionItem>;
}

Members

provideCompletionItems(document: LinesTextDocument, position: Position, token: CancellationToken, context?: CompletionContext): ProviderResult<CompletionItem[] | CompletionList>;

Provide completion items for the given position and document.

resolveCompletionItem?(item: CompletionItem, token: CancellationToken): ProviderResult<CompletionItem>;

Given a completion item fill in more data, like doc-comment or details.

The editor will only resolve a completion item once.

Kind
interface
Declaration
typings/index.d.ts:6139
types

HoverProvider

The hover provider interface defines the contract between extensions and the hover-feature.

Source

Interface definition

export interface HoverProvider {
    provideHover(document: LinesTextDocument, position: Position, token: CancellationToken): ProviderResult<Hover>;
}

Members

provideHover(document: LinesTextDocument, position: Position, token: CancellationToken): ProviderResult<Hover>;

Provide a hover for the given position and document. Multiple hovers at the same position will be merged by the editor. A hover can have a range which defaults to the word range at the position when omitted.

Kind
interface
Declaration
typings/index.d.ts:6179
types

DefinitionProvider

The definition provider interface defines the contract between extensions and the go to definition and peek definition features.

Source

Interface definition

export interface DefinitionProvider {
    provideDefinition(document: LinesTextDocument, position: Position, token: CancellationToken): ProviderResult<Definition | DefinitionLink[]>;
}

Members

provideDefinition(document: LinesTextDocument, position: Position, token: CancellationToken): ProviderResult<Definition | DefinitionLink[]>;

Provide the definition of the symbol at the given position and document.

Kind
interface
Declaration
typings/index.d.ts:6203
types

DeclarationProvider

The definition provider interface defines the contract between extensions and the go to definition and peek definition features.

Source

Interface definition

export interface DeclarationProvider {
    provideDeclaration(document: LinesTextDocument, position: Position, token: CancellationToken): ProviderResult<Definition | DefinitionLink[]>;
}

Members

provideDeclaration(document: LinesTextDocument, position: Position, token: CancellationToken): ProviderResult<Definition | DefinitionLink[]>;

Provide the declaration of the symbol at the given position and document.

Kind
interface
Declaration
typings/index.d.ts:6225
types

SignatureHelpProvider

The signature help provider interface defines the contract between extensions and the parameter hints-feature.

Source

Interface definition

export interface SignatureHelpProvider {
    provideSignatureHelp(document: LinesTextDocument, position: Position, token: CancellationToken, context: SignatureHelpContext): ProviderResult<SignatureHelp>;
}

Members

provideSignatureHelp(document: LinesTextDocument, position: Position, token: CancellationToken, context: SignatureHelpContext): ProviderResult<SignatureHelp>;

Provide help for the signature at the given position and document.

Kind
interface
Declaration
typings/index.d.ts:6240
types

TypeDefinitionProvider

The type definition provider defines the contract between extensions and the go to type definition feature.

Source

Interface definition

export interface TypeDefinitionProvider {
    provideTypeDefinition(document: LinesTextDocument, position: Position, token: CancellationToken): ProviderResult<Definition | DefinitionLink[]>;
}

Members

provideTypeDefinition(document: LinesTextDocument, position: Position, token: CancellationToken): ProviderResult<Definition | DefinitionLink[]>;

Provide the type definition of the symbol at the given position and document.

Kind
interface
Declaration
typings/index.d.ts:6262
types

ReferenceProvider

The reference provider interface defines the contract between extensions and the find references-feature.

Source

Interface definition

export interface ReferenceProvider {
    provideReferences(document: LinesTextDocument, position: Position, context: ReferenceContext, token: CancellationToken): ProviderResult<Location[]>;
}

Members

provideReferences(document: LinesTextDocument, position: Position, context: ReferenceContext, token: CancellationToken): ProviderResult<Location[]>;

Provide a set of project-wide references for the given position and document.

Kind
interface
Declaration
typings/index.d.ts:6283
types

FoldingContext

Folding context (for future use)

Source

Interface definition

export interface FoldingContext {
}
Kind
interface
Declaration
typings/index.d.ts:6305
types

FoldingRangeProvider

The folding range provider interface defines the contract between extensions and Folding in the editor.

Source

Interface definition

export interface FoldingRangeProvider {
    onDidChangeFoldingRanges?: Event<void>;
    provideFoldingRanges(document: LinesTextDocument, context: FoldingContext, token: CancellationToken): ProviderResult<FoldingRange[]>;
}

Members

onDidChangeFoldingRanges?: Event<void>;

An optional event to signal that the folding ranges from this provider have changed.

provideFoldingRanges(document: LinesTextDocument, context: FoldingContext, token: CancellationToken): ProviderResult<FoldingRange[]>;

Returns a list of folding ranges or null and undefined if the provider does not want to participate or was cancelled.

Kind
interface
Declaration
typings/index.d.ts:6311
types

DocumentSymbolProvider

The document symbol provider interface defines the contract between extensions and the go to symbol-feature.

Source

Interface definition

export interface DocumentSymbolProvider {
    provideDocumentSymbols(document: LinesTextDocument, token: CancellationToken): ProviderResult<SymbolInformation[] | DocumentSymbol[]>;
}

Members

provideDocumentSymbols(document: LinesTextDocument, token: CancellationToken): ProviderResult<SymbolInformation[] | DocumentSymbol[]>;

Provide symbol information for the given document.

Kind
interface
Declaration
typings/index.d.ts:6337
types

ImplementationProvider

The implementation provider interface defines the contract between extensions and the go to implementation feature.

Source

Interface definition

export interface ImplementationProvider {
    provideImplementation(document: LinesTextDocument, position: Position, token: CancellationToken): ProviderResult<Definition | DefinitionLink[]>;
}

Members

provideImplementation(document: LinesTextDocument, position: Position, token: CancellationToken): ProviderResult<Definition | DefinitionLink[]>;

Provide the implementations of the symbol at the given position and document.

Kind
interface
Declaration
typings/index.d.ts:6356
types

WorkspaceSymbolProvider

The workspace symbol provider interface defines the contract between extensions and the symbol search-feature.

Source

Interface definition

export interface WorkspaceSymbolProvider {
    provideWorkspaceSymbols(query: string, token: CancellationToken): ProviderResult<WorkspaceSymbol[]>;
    resolveWorkspaceSymbol?(symbol: WorkspaceSymbol, token: CancellationToken): ProviderResult<WorkspaceSymbol>;
}

Members

provideWorkspaceSymbols(query: string, token: CancellationToken): ProviderResult<WorkspaceSymbol[]>;

Project-wide search for a symbol matching the given query string. It is up to the provider how to search given the query string, like substring, indexOf etc. To improve performance implementors can skip the location of symbols and implement resolveWorkspaceSymbol to do that later.

The query-parameter should be interpreted in a relaxed way as the editor will apply its own highlighting and scoring on the results. A good rule of thumb is to match case-insensitive and to simply check that the characters of query appear in their order in a candidate symbol. Don't use prefix, substring, or similar strict matching.

resolveWorkspaceSymbol?(symbol: WorkspaceSymbol, token: CancellationToken): ProviderResult<WorkspaceSymbol>;

Given a symbol fill in its location. This method is called whenever a symbol is selected in the UI. Providers can implement this method and return incomplete symbols from provideWorkspaceSymbols which often helps to improve performance.

Kind
interface
Declaration
typings/index.d.ts:6377
types

RenameProvider

The rename provider interface defines the contract between extensions and the rename-feature.

Source

Interface definition

export interface RenameProvider {
    provideRenameEdits(document: LinesTextDocument, position: Position, newName: string, token: CancellationToken): ProviderResult<WorkspaceEdit>;
    prepareRename?(document: LinesTextDocument, position: Position, token: CancellationToken): ProviderResult<Range | {
        range: Range;
        placeholder: string;
    }>;
}

Members

provideRenameEdits(document: LinesTextDocument, position: Position, newName: string, token: CancellationToken): ProviderResult<WorkspaceEdit>;

Provide an edit that describes changes that have to be made to one or many resources to rename a symbol to a different name.

prepareRename?(document: LinesTextDocument, position: Position, token: CancellationToken): ProviderResult<Range | { range: Range; placeholder: string; }>;

Optional function for resolving and validating a position before running rename. The result can be a range or a range and a placeholder text. The placeholder text should be the identifier of the symbol which is being renamed - when omitted the text in the returned range is used.

Kind
interface
Declaration
typings/index.d.ts:6421
types

DocumentFormattingEditProvider

The document formatting provider interface defines the contract between extensions and the formatting-feature.

Source

Interface definition

export interface DocumentFormattingEditProvider {
    provideDocumentFormattingEdits(document: LinesTextDocument, options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;
}

Members

provideDocumentFormattingEdits(document: LinesTextDocument, options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;

Provide formatting edits for a whole document.

Kind
interface
Declaration
typings/index.d.ts:6461
types

DocumentRangeFormattingEditProvider

The document formatting provider interface defines the contract between extensions and the formatting-feature.

Source

Interface definition

export interface DocumentRangeFormattingEditProvider {
    provideDocumentRangeFormattingEdits(document: LinesTextDocument, range: Range, options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;
    provideDocumentRangesFormattingEdits?(document: LinesTextDocument, ranges: Range[], options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;
}

Members

provideDocumentRangeFormattingEdits(document: LinesTextDocument, range: Range, options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;

Provide formatting edits for a range in a document.

The given range is a hint and providers can decide to format a smaller or larger range. Often this is done by adjusting the start and end of the range to full syntax nodes.

provideDocumentRangesFormattingEdits?(document: LinesTextDocument, ranges: Range[], options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;

Provide formatting edits for multiple ranges in a document.

Kind
interface
Declaration
typings/index.d.ts:6482
types

CodeActionProvider

The code action interface defines the contract between extensions and the light bulb feature.

A code action can be any command that is known to the system.

Source

Interface definition

export interface CodeActionProvider<T extends CodeAction = CodeAction> {
    provideCodeActions(document: LinesTextDocument, range: Range, context: CodeActionContext, token: CancellationToken): ProviderResult<(Command | CodeAction)[]>;
    resolveCodeAction?(codeAction: T, token: CancellationToken): ProviderResult<T>;
}

Members

provideCodeActions(document: LinesTextDocument, range: Range, context: CodeActionContext, token: CancellationToken): ProviderResult<(Command | CodeAction)[]>;

Provide commands for the given document and range.

resolveCodeAction?(codeAction: T, token: CancellationToken): ProviderResult<T>;

Given a code action fill in its edit-property. Changes to all other properties, like title, are ignored. A code action that has an edit will not be resolved.

Kind
interface
Declaration
typings/index.d.ts:6528
types

CodeActionProviderMetadata

Metadata about the type of code actions that a CodeActionProvider providers

Source

Interface definition

export interface CodeActionProviderMetadata {
    readonly providedCodeActionKinds?: ReadonlyArray<string>;
}

Members

readonly providedCodeActionKinds?: ReadonlyArray<string>;

CodeActionKinds that this provider may return.

The list of kinds may be generic, such as CodeActionKind.Refactor, or the provider may list our every specific kind they provide, such as CodeActionKind.Refactor.Extract.append('function)`

Kind
interface
Declaration
typings/index.d.ts:6563
types

DocumentHighlightProvider

The document highlight provider interface defines the contract between extensions and the word-highlight-feature.

Source

Interface definition

export interface DocumentHighlightProvider {
    provideDocumentHighlights(document: LinesTextDocument, position: Position, token: CancellationToken): ProviderResult<DocumentHighlight[]>;
}

Members

provideDocumentHighlights(document: LinesTextDocument, position: Position, token: CancellationToken): ProviderResult<DocumentHighlight[]>;

Provide a set of document highlights, like all occurrences of a variable or all exit-points of a function.

Kind
interface
Declaration
typings/index.d.ts:6577
types

DocumentLinkProvider

The document link provider defines the contract between extensions and feature of showing links in the editor.

Source

Interface definition

export interface DocumentLinkProvider {
    provideDocumentLinks(document: LinesTextDocument, token: CancellationToken): ProviderResult<DocumentLink[]>;
    resolveDocumentLink?(link: DocumentLink, token: CancellationToken): ProviderResult<DocumentLink>;
}

Members

provideDocumentLinks(document: LinesTextDocument, token: CancellationToken): ProviderResult<DocumentLink[]>;

Provide links for the given document. Note that the editor ships with a default provider that detects http(s) and file links.

resolveDocumentLink?(link: DocumentLink, token: CancellationToken): ProviderResult<DocumentLink>;

Given a link fill in its target. This method is called when an incomplete link is selected in the UI. Providers can implement this method and return incomple links (without target) from the provideDocumentLinks method which often helps to improve performance.

Kind
interface
Declaration
typings/index.d.ts:6600
types

CodeLensProvider

A code lens provider adds commands to source text. The commands will be shown as dedicated horizontal lines in between the source text.

Source

Interface definition

export interface CodeLensProvider {
    provideCodeLenses(document: LinesTextDocument, token: CancellationToken): ProviderResult<CodeLens[]>;
    resolveCodeLens?(codeLens: CodeLens, token: CancellationToken): ProviderResult<CodeLens>;
}

Members

provideCodeLenses(document: LinesTextDocument, token: CancellationToken): ProviderResult<CodeLens[]>;

Compute a list of lenses. This call should return as fast as possible and if computing the commands is expensive implementors should only return code lens objects with the range set and implement resolve.

resolveCodeLens?(codeLens: CodeLens, token: CancellationToken): ProviderResult<CodeLens>;

This function will be called for each visible code lens, usually when scrolling and after calls to compute-lenses.

Kind
interface
Declaration
typings/index.d.ts:6629
types

OnTypeFormattingEditProvider

The document formatting provider interface defines the contract between extensions and the formatting-feature.

Source

Interface definition

export interface OnTypeFormattingEditProvider {
    provideOnTypeFormattingEdits(document: LinesTextDocument, position: Position, ch: string, options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;
}

Members

provideOnTypeFormattingEdits(document: LinesTextDocument, position: Position, ch: string, options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;

Provide formatting edits after a character has been typed.

The given position and character should hint to the provider what range the position to expand to, like find the matching { when } has been entered.

Kind
interface
Declaration
typings/index.d.ts:6658
types

DocumentColorProvider

The document color provider defines the contract between extensions and feature of picking and modifying colors in the editor.

Source

Interface definition

export interface DocumentColorProvider {
    provideDocumentColors(document: LinesTextDocument, token: CancellationToken): ProviderResult<ColorInformation[]>;
    provideColorPresentations(color: Color, context: {
        document: LinesTextDocument;
        range: Range;
    }, token: CancellationToken): ProviderResult<ColorPresentation[]>;
}

Members

provideDocumentColors(document: LinesTextDocument, token: CancellationToken): ProviderResult<ColorInformation[]>;

Provide colors for the given document.

provideColorPresentations(color: Color, context: { document: LinesTextDocument; range: Range; }, token: CancellationToken): ProviderResult<ColorPresentation[]>;

Provide representations for a color.

Kind
interface
Declaration
typings/index.d.ts:6682
types

TextDocumentContentProvider

Interface exported by coc.nvim.

Source

Interface definition

export interface TextDocumentContentProvider {
    onDidChange?: Event<Uri>;
    provideTextDocumentContent(uri: Uri, token: CancellationToken): ProviderResult<string>;
}

Members

onDidChange?: Event<Uri>;

An event to signal a resource has changed.

provideTextDocumentContent(uri: Uri, token: CancellationToken): ProviderResult<string>;

Provide textual content for a given uri.

The editor will use the returned string-content to create a readonly document. Resources allocated should be released when the corresponding document has been closed.

Kind
interface
Declaration
typings/index.d.ts:6706
types

SelectionRangeProvider

Interface exported by coc.nvim.

Source

Interface definition

export interface SelectionRangeProvider {
    provideSelectionRanges(document: LinesTextDocument, positions: Position[], token: CancellationToken): ProviderResult<SelectionRange[]>;
}

Members

provideSelectionRanges(document: LinesTextDocument, positions: Position[], token: CancellationToken): ProviderResult<SelectionRange[]>;

Provide selection ranges starting at a given position. The first range must contain position and subsequent ranges must contain the previous range.

Kind
interface
Declaration
typings/index.d.ts:6727
types

CallHierarchyProvider

The call hierarchy provider interface describes the contract between extensions and the call hierarchy feature which allows to browse calls and caller of function, methods, constructor etc.

Source

Interface definition

export interface CallHierarchyProvider {
    prepareCallHierarchy(document: LinesTextDocument, position: Position, token: CancellationToken): ProviderResult<CallHierarchyItem | CallHierarchyItem[]>;
    provideCallHierarchyIncomingCalls(item: CallHierarchyItem, token: CancellationToken): ProviderResult<CallHierarchyIncomingCall[]>;
    provideCallHierarchyOutgoingCalls(item: CallHierarchyItem, token: CancellationToken): ProviderResult<CallHierarchyOutgoingCall[]>;
}

Members

prepareCallHierarchy(document: LinesTextDocument, position: Position, token: CancellationToken): ProviderResult<CallHierarchyItem | CallHierarchyItem[]>;

Bootstraps call hierarchy by returning the item that is denoted by the given document and position. This item will be used as entry into the call graph. Providers should return undefined or null when there is no item at the given location.

provideCallHierarchyIncomingCalls(item: CallHierarchyItem, token: CancellationToken): ProviderResult<CallHierarchyIncomingCall[]>;

Provide all incoming calls for an item, e.g all callers for a method. In graph terms this describes directed and annotated edges inside the call graph, e.g the given item is the starting node and the result is the nodes that can be reached.

provideCallHierarchyOutgoingCalls(item: CallHierarchyItem, token: CancellationToken): ProviderResult<CallHierarchyOutgoingCall[]>;

Provide all outgoing calls for an item, e.g call calls to functions, methods, or constructors from the given item. In graph terms this describes directed and annotated edges inside the call graph, e.g the given item is the starting node and the result is the nodes that can be reached.

Kind
interface
Declaration
typings/index.d.ts:6740
types

DocumentSemanticTokensProvider

The document semantic tokens provider interface defines the contract between extensions and semantic tokens.

Source

Interface definition

export interface DocumentSemanticTokensProvider {
    onDidChangeSemanticTokens?: Event<void>;
    provideDocumentSemanticTokens(document: LinesTextDocument, token: CancellationToken): ProviderResult<SemanticTokens>;
    provideDocumentSemanticTokensEdits?(document: LinesTextDocument, previousResultId: string, token: CancellationToken): ProviderResult<SemanticTokens | SemanticTokensDelta>;
}

Members

onDidChangeSemanticTokens?: Event<void>;

An optional event to signal that the semantic tokens from this provider have changed.

provideDocumentSemanticTokens(document: LinesTextDocument, token: CancellationToken): ProviderResult<SemanticTokens>;

Tokens in a file are represented as an array of integers. The position of each token is expressed relative to the token before it, because most tokens remain stable relative to each other when edits are made in a file.


In short, each token takes 5 integers to represent, so a specific token i in the file consists of the following array indices:

  • at index 5*i - deltaLine: token line number, relative to the previous token
  • at index 5*i+1 - deltaStart: token start character, relative to the previous token (relative to 0 or the previous token's start if they are on the same line)
  • at index 5*i+2 - length: the length of the token. A token cannot be multiline.
  • at index 5*i+3 - tokenType: will be looked up in SemanticTokensLegend.tokenTypes. We currently ask that tokenType < 65536.
  • at index 5*i+4 - tokenModifiers: each set bit will be looked up in SemanticTokensLegend.tokenModifiers

How to encode tokens

Here is an example for encoding a file with 3 tokens in a uint32 array:

   { line: 2, startChar:  5, length: 3, tokenType: "property",  tokenModifiers: ["private", "static"] },
   { line: 2, startChar: 10, length: 4, tokenType: "type",      tokenModifiers: [] },
   { line: 5, startChar:  2, length: 7, tokenType: "class",     tokenModifiers: [] }
  1. First of all, a legend must be devised. This legend must be provided up-front and capture all possible token types. For this example, we will choose the following legend which must be passed in when registering the provider:
   tokenTypes: ['property', 'type', 'class'],
   tokenModifiers: ['private', 'static']
  1. The first transformation step is to encode tokenType and tokenModifiers as integers using the legend. Token types are looked up by index, so a tokenType value of 1 means tokenTypes[1]. Multiple token modifiers can be set by using bit flags, so a tokenModifier value of 3 is first viewed as binary 0b00000011, which means [tokenModifiers[0], tokenModifiers[1]] because bits 0 and 1 are set. Using this legend, the tokens now are:
   { line: 2, startChar:  5, length: 3, tokenType: 0, tokenModifiers: 3 },
   { line: 2, startChar: 10, length: 4, tokenType: 1, tokenModifiers: 0 },
   { line: 5, startChar:  2, length: 7, tokenType: 2, tokenModifiers: 0 }
  1. The next step is to represent each token relative to the previous token in the file. In this case, the second token is on the same line as the first token, so the startChar of the second token is made relative to the startChar of the first token, so it will be 10 - 5. The third token is on a different line than the second token, so the startChar of the third token will not be altered:
   { deltaLine: 2, deltaStartChar: 5, length: 3, tokenType: 0, tokenModifiers: 3 },
   { deltaLine: 0, deltaStartChar: 5, length: 4, tokenType: 1, tokenModifiers: 0 },
   { deltaLine: 3, deltaStartChar: 2, length: 7, tokenType: 2, tokenModifiers: 0 }
  1. Finally, the last step is to inline each of the 5 fields for a token in a single array, which is a memory friendly representation:
   // 1st token,  2nd token,  3rd token
   [  2,5,3,0,3,  0,5,4,1,0,  3,2,7,2,0 ]
provideDocumentSemanticTokensEdits?(document: LinesTextDocument, previousResultId: string, token: CancellationToken): ProviderResult<SemanticTokens | SemanticTokensDelta>;

Instead of always returning all the tokens in a file, it is possible for a DocumentSemanticTokensProvider to implement this method (provideDocumentSemanticTokensEdits) and then return incremental updates to the previously provided semantic tokens.


How tokens change when the document changes

Suppose that provideDocumentSemanticTokens has previously returned the following semantic tokens:

   // 1st token,  2nd token,  3rd token
   [  2,5,3,0,3,  0,5,4,1,0,  3,2,7,2,0 ]

Also suppose that after some edits, the new semantic tokens in a file are:

   // 1st token,  2nd token,  3rd token
   [  3,5,3,0,3,  0,5,4,1,0,  3,2,7,2,0 ]

It is possible to express these new tokens in terms of an edit applied to the previous tokens:

   [  2,5,3,0,3,  0,5,4,1,0,  3,2,7,2,0 ] // old tokens
   [  3,5,3,0,3,  0,5,4,1,0,  3,2,7,2,0 ] // new tokens

   edit: { start:  0, deleteCount: 1, data: [3] } // replace integer at offset 0 with 3

NOTE: If the provider cannot compute SemanticTokensEdits, it can "give up" and return all the tokens in the document again. NOTE: All edits in SemanticTokensEdits contain indices in the old integers array, so they all refer to the previous result state.

Kind
interface
Declaration
typings/index.d.ts:6784
types

DocumentRangeSemanticTokensProvider

The document range semantic tokens provider interface defines the contract between extensions and semantic tokens.

Source

Interface definition

export interface DocumentRangeSemanticTokensProvider {
    provideDocumentRangeSemanticTokens(document: LinesTextDocument, range: Range, token: CancellationToken): ProviderResult<SemanticTokens>;
}

Members

provideDocumentRangeSemanticTokens(document: LinesTextDocument, range: Range, token: CancellationToken): ProviderResult<SemanticTokens>;
Kind
interface
Declaration
typings/index.d.ts:6888
types

LinkedEditingRangeProvider

Interface exported by coc.nvim.

Source

Interface definition

export interface LinkedEditingRangeProvider {
    provideLinkedEditingRanges(document: LinesTextDocument, position: Position, token: CancellationToken): ProviderResult<LinkedEditingRanges>;
}

Members

provideLinkedEditingRanges(document: LinesTextDocument, position: Position, token: CancellationToken): ProviderResult<LinkedEditingRanges>;

For a given position in a document, returns the range of the symbol at the position and all ranges that have the same content. A change to one of the ranges can be applied to all other ranges if the new content is valid. An optional word pattern can be returned with the result to describe valid contents. If no result-specific word pattern is provided, the word pattern from the language configuration is used.

Kind
interface
Declaration
typings/index.d.ts:6895
types

InlayHintsProvider

The inlay hints provider interface defines the contract between extensions and the inlay hints feature.

Source

Interface definition

export interface InlayHintsProvider<T extends InlayHint = InlayHint> {
    onDidChangeInlayHints?: Event<void>;
    provideInlayHints(document: LinesTextDocument, range: Range, token: CancellationToken): ProviderResult<T[]>;
    resolveInlayHint?(hint: T, token: CancellationToken): ProviderResult<T>;
}

Members

onDidChangeInlayHints?: Event<void>;

An optional event to signal that inlay hints from this provider have changed.

provideInlayHints(document: LinesTextDocument, range: Range, token: CancellationToken): ProviderResult<T[]>;

Provide inlay hints for the given range and document.

Note that inlay hints that are not contained by the given range are ignored.

resolveInlayHint?(hint: T, token: CancellationToken): ProviderResult<T>;

Given an inlay hint fill in tooltip, text edits, or complete label parts.

Note that the editor will resolve an inlay hint at most once.

Kind
interface
Declaration
typings/index.d.ts:6914
types

TypeHierarchyProvider

The type hierarchy provider interface describes the contract between extensions and the type hierarchy feature.

Source

Interface definition

export interface TypeHierarchyProvider {
    prepareTypeHierarchy(document: LinesTextDocument, position: Position, token: CancellationToken): ProviderResult<TypeHierarchyItem[]>;
    provideTypeHierarchySupertypes(item: TypeHierarchyItem, token: CancellationToken): ProviderResult<TypeHierarchyItem[]>;
    provideTypeHierarchySubtypes(item: TypeHierarchyItem, token: CancellationToken): ProviderResult<TypeHierarchyItem[]>;
}

Members

prepareTypeHierarchy(document: LinesTextDocument, position: Position, token: CancellationToken): ProviderResult<TypeHierarchyItem[]>;

Bootstraps type hierarchy by returning the item that is denoted by the given document and position. This item will be used as entry into the type graph. Providers should return undefined or null when there is no item at the given location.

provideTypeHierarchySupertypes(item: TypeHierarchyItem, token: CancellationToken): ProviderResult<TypeHierarchyItem[]>;

Provide all supertypes for an item, e.g all types from which a type is derived/inherited. In graph terms this describes directed and annotated edges inside the type graph, e.g the given item is the starting node and the result is the nodes that can be reached.

provideTypeHierarchySubtypes(item: TypeHierarchyItem, token: CancellationToken): ProviderResult<TypeHierarchyItem[]>;

Provide all subtypes for an item, e.g all types which are derived/inherited from the given item. In graph terms this describes directed and annotated edges inside the type graph, e.g the given item is the starting node and the result is the nodes that can be reached.

Kind
interface
Declaration
typings/index.d.ts:6950
types

InlineValuesProvider

The inline values provider interface defines the contract between extensions and the editor's debugger inline values feature. In this contract the provider returns inline value information for a given document range and the editor shows this information in the editor at the end of lines.

Source

Interface definition

export interface InlineValuesProvider {
    onDidChangeInlineValues?: Event<void> | undefined;
    provideInlineValues(document: TextDocument, viewPort: Range, context: InlineValueContext, token: CancellationToken): ProviderResult<InlineValue[]>;
}

Members

onDidChangeInlineValues?: Event<void> | undefined;

An optional event to signal that inline values have changed.

provideInlineValues(document: TextDocument, viewPort: Range, context: InlineValueContext, token: CancellationToken): ProviderResult<InlineValue[]>;

Provide "inline value" information for a given document and range. The editor calls this method whenever debugging stops in the given document. The returned inline values information is rendered in the editor at the end of lines.

Kind
interface
Declaration
typings/index.d.ts:6995
types

DiagnosticProvider

Interface exported by coc.nvim.

Source

Interface definition

export interface DiagnosticProvider {
    onDidChangeDiagnostics: Event<void> | undefined;
    provideDiagnostics(document: TextDocument | Uri, previousResultId: string | undefined, token: CancellationToken): ProviderResult<DocumentDiagnosticReport>;
    provideWorkspaceDiagnostics?(resultIds: PreviousResultId[], token: CancellationToken, resultReporter: ResultReporter): ProviderResult<WorkspaceDiagnosticReport>;
}

Members

onDidChangeDiagnostics: Event<void> | undefined;

Event fired when diagnostics of a document change.

provideDiagnostics(document: TextDocument | Uri, previousResultId: string | undefined, token: CancellationToken): ProviderResult<DocumentDiagnosticReport>;

Provide diagnostics for the given document.

provideWorkspaceDiagnostics?(resultIds: PreviousResultId[], token: CancellationToken, resultReporter: ResultReporter): ProviderResult<WorkspaceDiagnosticReport>;

Provide workspace diagnostics.

Kind
interface
Declaration
typings/index.d.ts:7017
types

InlineCompletionItemProvider

The inline completion item provider interface defines the contract between extensions and the inline completion feature.

Providers are asked for completions either explicitly by a user gesture or implicitly when typing.

Source

Interface definition

export interface InlineCompletionItemProvider {
    provideInlineCompletionItems(document: TextDocument, position: Position, context: InlineCompletionContext, token: CancellationToken): ProviderResult<InlineCompletionItem[] | InlineCompletionList>;
}

Members

provideInlineCompletionItems(document: TextDocument, position: Position, context: InlineCompletionContext, token: CancellationToken): ProviderResult<InlineCompletionItem[] | InlineCompletionList>;

Provides inline completion items for the given position and document. If inline completions are enabled, this method will be called whenever the user stopped typing. It will also be called when the user explicitly triggers inline completions or explicitly asks for the next or previous inline completion. In that case, all available inline completions should be returned. context.triggerKind can be used to distinguish between these scenarios.

Kind
interface
Declaration
typings/index.d.ts:7038
types

NextEditProvider

Provider contract for returning Next Edit candidates and receiving notifications when a candidate is shown.

Source

Interface definition

export interface NextEditProvider {
    provideNextEdits(document: TextDocument, position: Position, context: NextEditContext, token: CancellationToken): ProviderResult<NextEditItem[] | NextEditList>;
    handleDidShowNextEdit?(item: NextEditItem): void | Thenable<void>;
}

Members

provideNextEdits(document: TextDocument, position: Position, context: NextEditContext, token: CancellationToken): ProviderResult<NextEditItem[] | NextEditList>;
handleDidShowNextEdit?(item: NextEditItem): void | Thenable<void>;

Example

import {
  ExtensionContext,
  languages,
  NextEditProvider,
  Range,
} from 'coc.nvim'

export function activate(context: ExtensionContext): void {
  const provider: NextEditProvider = {
    provideNextEdits(document, position, _nextEditContext, token) {
      if (token.isCancellationRequested) return null
      return [{
        textDocument: { uri: document.uri, version: document.version },
        range: Range.create(position, position),
        newText: 'generatedText',
      }]
    },
  }

  context.subscriptions.push(
    languages.registerNextEditProvider([{ language: 'typescript' }], provider),
  )
}
Kind
interface
Declaration
typings/index.d.ts:7076
types

CancellationError

An error type that should be used to signal cancellation of an operation.

This type can be used in response to a cancellation token being cancelled or when an operation is being cancelled by the executor of that operation.

Source

Class definition

export class CancellationError extends Error {
    constructor();
}

Members

constructor();

Creates a new cancellation error.

Kind
class
Declaration
typings/index.d.ts:7090
types

SemanticTokensBuilder

A semantic tokens builder can help with creating a SemanticTokens instance which contains delta encoded semantic tokens.

Source

Class definition

export class SemanticTokensBuilder {
    constructor(legend?: SemanticTokensLegend);
    push(line: number, char: number, length: number, tokenType: number, tokenModifiers?: number): void;
    push(range: Range, tokenType: string, tokenModifiers?: string[]): void;
    build(resultId?: string): SemanticTokens;
}

Members

constructor(legend?: SemanticTokensLegend);
push(line: number, char: number, length: number, tokenType: number, tokenModifiers?: number): void;

Add another token.

push(range: Range, tokenType: string, tokenModifiers?: string[]): void;

Add another token. Use only when providing a legend.

build(resultId?: string): SemanticTokens;

Finish and create a SemanticTokens instance.

Kind
class
Declaration
typings/index.d.ts:7102
types

Document

Interface exported by coc.nvim.

Source

Interface definition

export interface Document {
    readonly buffer: Buffer;
    readonly attached: boolean;
    readonly isCommandLine: boolean;
    readonly buftype: string;
    readonly textDocument: LinesTextDocument;
    readonly onDocumentChange: Event<DidChangeTextDocumentParams>;
    readonly changedtick: number;
    readonly schema: string;
    readonly lineCount: number;
    readonly winid: number;
    readonly previewwindow: boolean;
    readonly dirty: boolean;
    readonly bufnr: number;
    readonly content: string;
    readonly filetype: string;
    readonly languageId: string;
    readonly uri: string;
    readonly version: number;
    readonly lines: ReadonlyArray<string>;
    applyEdits(edits: TextEdit[], joinUndo?: boolean, move?: boolean | Position): Promise<void>;
    synchronize(): Promise<void>;
    changeLines(lines: [
        number,
        string
    ][]): Promise<void>;
    getOffset(lnum: number, col: number): number;
    isWord(word: string): boolean;
    getWordRangeAtPosition(position: Position, extraChars?: string, current?: boolean): Range | null;
    getSymbolRanges(word: string): Range[];
    getline(line: number, current?: boolean): string;
    getLines(start?: number, end?: number): string[];
    getVar<T>(key: string, defaultValue?: T): T;
    getPosition(lnum: number, col: number): Position;
    fixStartcol(position: Position, valids: string[]): number;
    getDocumentContent(): string;
}

Members

readonly buffer: Buffer;

Buffer of the document.

readonly attached: boolean;

Document is attached to vim.

readonly isCommandLine: boolean;

Is command line document.

readonly buftype: string;

buftype option of buffer.

readonly textDocument: LinesTextDocument;

Text document that synchronized.

readonly onDocumentChange: Event<DidChangeTextDocumentParams>;

Fired when document change.

readonly changedtick: number;

Get current buffer changedtick.

readonly schema: string;

Scheme of document.

readonly lineCount: number;

Line count of current buffer.

readonly winid: number;

Window ID when buffer create, could be -1 when no window associated.

readonly previewwindow: boolean;

Returns if current document is opened with previewwindow

readonly dirty: boolean;

Check if document changed after last synchronize

readonly bufnr: number;

Buffer number

readonly content: string;

Content of textDocument.

readonly filetype: string;

Converted filetype.

readonly languageId: string;

Main filetype of buffer, first part when buffer filetype contains dots. Same as filetype most of the time.

readonly uri: string;

Uri of the document.

readonly version: number;

Version of the document.

readonly lines: ReadonlyArray<string>;

Current lines of buffer

applyEdits(edits: TextEdit[], joinUndo?: boolean, move?: boolean | Position): Promise<void>;

Apply text edits to document. nvim_buf_set_text() is used when possible

synchronize(): Promise<void>;

Synchronize latest buffer lines to vim. This method is needed after applyEdits to wait for buffer synchronize with changed lines.

changeLines(lines: [ number, string ][]): Promise<void>;

Change individual lines.

getOffset(lnum: number, col: number): number;

Get offset from lnum & col

isWord(word: string): boolean;

Check string is word.

getWordRangeAtPosition(position: Position, extraChars?: string, current?: boolean): Range | null;

Word range at position.

getSymbolRanges(word: string): Range[];

Get ranges of word in textDocument.

getline(line: number, current?: boolean): string;

Get line for buffer

getLines(start?: number, end?: number): string[];

Get range of current lines, zero indexed, end exclude.

getVar<T>(key: string, defaultValue?: T): T;

Get variable value by key, defined by b:coc_{key}

getPosition(lnum: number, col: number): Position;

Get position from lnum & col

fixStartcol(position: Position, valids: string[]): number;

Adjust col with new valid character before position.

getDocumentContent(): string;

Get current content text, consider eol option.

Kind
interface
Declaration
typings/index.d.ts:7134
types

TextEditorOptions

Represents a text editor's options.

Source

Interface definition

export interface TextEditorOptions {
    tabSize: number;
    insertSpaces: boolean;
    trimTrailingWhitespace?: boolean;
    insertFinalNewline?: boolean;
    trimFinalNewlines?: boolean;
}

Members

tabSize: number;

The size in spaces a tab takes. This is used for two purposes:

  • the rendering width of a tab character;
  • the number of spaces to insert when insertSpaces is true.

When getting a text editor's options, this property will always be a number (resolved).

insertSpaces: boolean;

When pressing Tab insert n spaces. When getting a text editor's options, this property will always be a boolean (resolved).

trimTrailingWhitespace?: boolean;

Trim trailing whitespace on a line.

insertFinalNewline?: boolean;

Insert a newline character at the end of the file if one does not exist.

trimFinalNewlines?: boolean;

Trim all newlines after the final newline at the end of the file.

Kind
interface
Declaration
typings/index.d.ts:7300
types

TextEditor

Represents an editor that is attached to a document.

Source

Interface definition

export interface TextEditor {
    readonly tabpageid: number;
    readonly winid: number;
    readonly winnr: number;
    readonly document: Document;
    readonly visibleRanges: readonly Range[];
    readonly options: TextEditorOptions;
}

Members

readonly tabpageid: number;

The tabpageid of current editor.

readonly winid: number;

The window id of current editor.

readonly winnr: number;

The window number of current editor.

readonly document: Document;

The document associated with this text editor. The document will be the same for the entire lifetime of this text editor.

readonly visibleRanges: readonly Range[];

The current visible ranges in the editor (vertically). This accounts only for vertical scrolling, and not for horizontal scrolling.

readonly options: TextEditorOptions;

Text editor options.

Kind
interface
Declaration
typings/index.d.ts:7331
types

Documentation

Interface exported by coc.nvim.

Source

Interface definition

export interface Documentation {
    filetype: string;
    content: string;
    active?: [
        number,
        number
    ];
    highlights?: HighlightItem[];
}

Members

filetype: string;

Filetype used for highlight, markdown is supported.

content: string;

Content of document.

active?: [ number, number ];

Byte offset (0 based) that should be undelined.

highlights?: HighlightItem[];

Highlights of the document.

Kind
interface
Declaration
typings/index.d.ts:7359
types

GlobPattern

A file glob pattern to match file paths against. This can either be a glob pattern string (like **​/*.{ts,js} or *.{ts,js}) or a relative pattern.

Glob patterns can have the following syntax:

  • * to match one or more characters in a path segment
  • ? to match on one character in a path segment
  • ** to match any number of path segments, including none
  • {} to group conditions (e.g. **​/*.{ts,js} matches all TypeScript and JavaScript files)
  • [] to declare a range of characters to match in a path segment (e.g., example.[0-9] to match on example.0, example.1, …)
  • [!...] to negate a range of characters to match in a path segment (e.g., example.[!0-9] to match on example.a, example.b, but not example.0)

Note: a backslash (\) is not valid within a glob pattern. If you have an existing file path to match against, consider to use the relative pattern support that takes care of converting any backslash into slash. Otherwise, make sure to convert any backslash to slash when creating the glob pattern.

Source

Type definition

export type GlobPattern = string | RelativePattern;
Kind
type alias
Declaration
typings/index.d.ts:7395
types

RelativePattern

A relative pattern is a helper to construct glob patterns that are matched relatively to a base file path. The base path can either be an absolute file path as string or uri or a workspace folder, which is the preferred way of creating the relative pattern.

Source

Class definition

export class RelativePattern {
    baseUri: Uri;
    pattern: string;
    constructor(base: WorkspaceFolder | Uri | string, pattern: string);
    toJSON(): {
        pattern: string;
        baseUri: UriComponents;
    };
}

Members

baseUri: Uri;

A base file path to which this pattern will be matched against relatively.

pattern: string;

A file glob pattern like *.{ts,js} that will be matched on file paths relative to the base path.

Example: Given a base of /home/work/folder and a file path of /home/work/folder/index.js, the file glob pattern will match on index.js.

constructor(base: WorkspaceFolder | Uri | string, pattern: string);

Creates a new relative pattern object with a base file path and pattern to match. This pattern will be matched on file paths relative to the base.

Example:

const folder = vscode.workspace.workspaceFolders?.[0];
if (folder) {

  // Match any TypeScript file in the root of this workspace folder
  const pattern1 = new vscode.RelativePattern(folder, '*.ts');

  // Match any TypeScript file in `someFolder` inside this workspace folder
  const pattern2 = new vscode.RelativePattern(folder, 'someFolder/*.ts');
}
toJSON(): { pattern: string; baseUri: UriComponents; };

Serialize to a JSON object with pattern and baseUri components.

Kind
class
Declaration
typings/index.d.ts:7403
types

Highlighter

Build buffer with lines and highlights

Source

Class definition

export class Highlighter {
    addLine(line: string, hlGroup?: string): void;
    addLines(lines: string[]): void;
    addTexts(items: {
        text: string;
        hlGroup?: string;
    }[]): void;
    addText(text: string, hlGroup?: string): void;
    get length(): number;
    getline(line: number): string;
    get highlights(): ReadonlyArray<HighlightItem>;
    get content(): string;
    render(buffer: Buffer, start?: number, end?: number): void;
}

Members

addLine(line: string, hlGroup?: string): void;

Add a line with highlight group.

addLines(lines: string[]): void;

Add lines without highlights.

addTexts(items: { text: string; hlGroup?: string; }[]): void;

Add texts to new lines, each text may have its own highlight group.

addText(text: string, hlGroup?: string): void;

Add text with highlight.

get length(): number;

Get line count

getline(line: number): string;

Get content of specific line.

get highlights(): ReadonlyArray<HighlightItem>;

Highlights of the buffer.

get content(): string;

Content of all lines joined by newline.

render(buffer: Buffer, start?: number, end?: number): void;

Render lines to buffer at specified range. Since notifications is used, use nvim.pauseNotification & nvim.resumeNotification when you need to wait for the request finish.

Kind
class
Declaration
typings/index.d.ts:7451
types

LineBuilder

Build line with content and highlights.

Source

Class definition

export class LineBuilder {
    constructor(addSpace?: boolean);
    append(text: string, hlGroup?: string, nested?: {
        offset: number;
        length: number;
        hlGroup: string;
    }[]): void;
    appendBuilder(builder: LineBuilder): void;
    get label(): string;
    get highlights(): AnsiHighlight[];
}

Members

constructor(addSpace?: boolean);
append(text: string, hlGroup?: string, nested?: { offset: number; length: number; hlGroup: string; }[]): void;

Append text with optional highlight group and nested highlights.

appendBuilder(builder: LineBuilder): void;

Append another builder to this one.

get label(): string;

Content of the line.

get highlights(): AnsiHighlight[];

Highlights of the line.

Kind
class
Declaration
typings/index.d.ts:7504
types

ListConfiguration

Interface exported by coc.nvim.

Source

Interface definition

export interface ListConfiguration {
    get<T>(key: string, defaultValue?: T): T;
    previousKey(): string;
    nextKey(): string;
    dispose(): void;
}

Members

get<T>(key: string, defaultValue?: T): T;

Get value of configuration key.

previousKey(): string;

Get previous key of configuration.

nextKey(): string;

Get next key of configuration.

dispose(): void;

Dispose the configuration watcher.

Kind
interface
Declaration
typings/index.d.ts:7524
types

ListActionOptions

Interface exported by coc.nvim.

Source

Interface definition

export interface ListActionOptions {
    persist?: boolean;
    reload?: boolean;
    parallel?: boolean;
    tabPersist?: boolean;
}

Members

persist?: boolean;

No prompt stop and window switch when invoked.

reload?: boolean;

Reload list after action invoked.

parallel?: boolean;

Support multiple items as execute argument.

tabPersist?: boolean;

Tab positioned list should be persisted (no window switch) on action invoke.

Kind
interface
Declaration
typings/index.d.ts:7543
types

CommandTaskOption

Interface exported by coc.nvim.

Source

Interface definition

export interface CommandTaskOption {
    cmd: string;
    args: string[];
    cwd?: string;
    env?: NodeJS.ProcessEnv;
    onLine: (line: string) => ListItem | undefined;
}

Members

cmd: string;

Command to run.

args: string[];

Arguments of command.

cwd?: string;

Current working directory.

env?: NodeJS.ProcessEnv;

Environment variables of the command.

onLine: (line: string) => ListItem | undefined;

Runs for each line, return undefined for invalid item.

Kind
interface
Declaration
typings/index.d.ts:7562
types

BasicList

Class exported by coc.nvim.

Source

Class definition

export abstract class BasicList implements IList {
    name: string;
    defaultAction: string;
    readonly actions: ListAction[];
    options: ListArgument[];
    protected nvim: Neovim;
    protected disposables: Disposable[];
    public config: ListConfiguration;
    constructor();
    get alignColumns(): boolean;
    protected get floatPreview(): boolean;
    protected get hlGroup(): string;
    protected get previewHeight(): number;
    protected get splitRight(): boolean;
    protected get toplineStyle(): string;
    protected get toplineOffset(): number;
    public parseArguments(args: string[]): {
        [key: string]: string | boolean;
    };
    protected getConfig(): WorkspaceConfiguration;
    protected addAction(name: string, fn: (item: ListItem, context: ListContext) => ProviderResult<void>, options?: ListActionOptions): void;
    protected addMultipleAction(name: string, fn: (item: ListItem[], context: ListContext) => ProviderResult<void>, options?: ListActionOptions): void;
    protected createCommandTask(opt: CommandTaskOption): ListTask;
    public addLocationActions(): void;
    public convertLocation(location: LocationWithTarget | LocationWithLine | string): Promise<LocationWithTarget>;
    public jumpTo(location: Location | LocationWithLine | string, command?: string, context?: ListContext): Promise<void>;
    public createAction(action: ListAction): void;
    protected previewLocation(location: LocationWithTarget, context: ListContext): Promise<void>;
    public preview(options: PreviewOptions, context: ListContext): Promise<void>;
    doHighlight(): void;
    abstract loadItems(context: ListContext, token?: CancellationToken): Promise<ListItem[] | ListTask | null | undefined>;
    dispose(): void;
}

Members

name: string;

Unique name, must be provided by implementation class.

defaultAction: string;

Default action name invoked by <cr> by default, must be provided by implementation class.

readonly actions: ListAction[];

Registered actions.

options: ListArgument[];

Arguments configuration of list.

protected nvim: Neovim;
protected disposables: Disposable[];
public config: ListConfiguration;

Configuration of the current list.

constructor();
get alignColumns(): boolean;

Should align columns when true.

protected get floatPreview(): boolean;
protected get hlGroup(): string;
protected get previewHeight(): number;
protected get splitRight(): boolean;
protected get toplineStyle(): string;
protected get toplineOffset(): number;
public parseArguments(args: string[]): { [key: string]: string | boolean; };

Parse argument string array for argument object from this.options. Could be used inside this.loadItems()

protected getConfig(): WorkspaceConfiguration;

Get configurations of current list

protected addAction(name: string, fn: (item: ListItem, context: ListContext) => ProviderResult<void>, options?: ListActionOptions): void;

Add an action

protected addMultipleAction(name: string, fn: (item: ListItem[], context: ListContext) => ProviderResult<void>, options?: ListActionOptions): void;

Add action that support multiple selection.

protected createCommandTask(opt: CommandTaskOption): ListTask;

Create task from command task option.

public addLocationActions(): void;

Add location related actions, should be called in constructor.

public convertLocation(location: LocationWithTarget | LocationWithLine | string): Promise<LocationWithTarget>;

Convert location to a Location object.

public jumpTo(location: Location | LocationWithLine | string, command?: string, context?: ListContext): Promise<void>;

Jump to location

public createAction(action: ListAction): void;

Add an action to this list.

protected previewLocation(location: LocationWithTarget, context: ListContext): Promise<void>;

Preview location.

public preview(options: PreviewOptions, context: ListContext): Promise<void>;

Preview lines.

doHighlight(): void;

Use for syntax highlights, invoked after buffer loaded.

abstract loadItems(context: ListContext, token?: CancellationToken): Promise<ListItem[] | ListTask | null | undefined>;

Invoked for listItems or listTask, could throw error when failed to load.

dispose(): void;

Dispose the list, dispose registered disposables.

Kind
class
Declaration
typings/index.d.ts:7585
types

Mutex

Class exported by coc.nvim.

Source

Class definition

export class Mutex {
    get busy(): boolean;
    acquire(): Promise<() => void>;
    use<T>(f: () => Promise<T>): Promise<T>;
    reset(): void;
}

Members

get busy(): boolean;

Returns true when task is running.

acquire(): Promise<() => void>;

Resolved release function that must be called after task finish.

use<T>(f: () => Promise<T>): Promise<T>;

Captrue the async task function that ensures to be executed one by one.

reset(): void;

Reset the mutex, clear pending tasks.

Kind
class
Declaration
typings/index.d.ts:7680
types

AnsiItem

Interface exported by coc.nvim.

Source

Interface definition

export interface AnsiItem {
    foreground?: string;
    background?: string;
    bold?: boolean;
    italic?: boolean;
    underline?: boolean;
    text: string;
}

Members

foreground?: string;

Foreground color of the text.

background?: string;

Background color of the text.

bold?: boolean;

Text is bold when true.

italic?: boolean;

Text is italic when true.

underline?: boolean;

Text is underlined when true.

text: string;

The text content.

Kind
interface
Declaration
typings/index.d.ts:7702
types

ParsedUrlQueryInput

Interface exported by coc.nvim.

Source

Interface definition

export interface ParsedUrlQueryInput {
    [key: string]: unknown;
}

Members

[key: string]: unknown;
Kind
interface
Declaration
typings/index.d.ts:7729
types

FetchOptions

Interface exported by coc.nvim.

Source

Interface definition

export interface FetchOptions {
    method?: string;
    timeout?: number;
    buffer?: boolean;
    data?: string | {
        [key: string]: any;
    } | Buffer;
    query?: ParsedUrlQueryInput;
    headers?: Record<string, string>;
    user?: string;
    password?: string;
    maxResponseSize?: number;
}

Members

method?: string;

Default to 'GET'

timeout?: number;

Default no timeout

buffer?: boolean;

Always return buffer instead of parsed response.

data?: string | { [key: string]: any; } | Buffer;

Data send to server.

query?: ParsedUrlQueryInput;

Plain object added as query of url

headers?: Record<string, string>;

Headers of the request.

user?: string;

User for http basic auth, should use with password

password?: string;

Password for http basic auth, should use with user

maxResponseSize?: number;

Maximum decompressed response size in bytes. Defaults to 128 MiB.

Kind
interface
Declaration
typings/index.d.ts:7733
types

DownloadOptions

Interface exported by coc.nvim.

Source

Interface definition

export interface DownloadOptions extends Omit<FetchOptions, 'buffer' | 'maxResponseSize'> {
    dest: string;
    strip?: number;
    etagAlgorithm?: string;
    extract?: boolean | 'untar' | 'unzip';
    onProgress?: (percent: string) => void;
    maxDownloadSize?: number;
    maxExtractSize?: number;
    maxArchiveEntries?: number;
}

Members

dest: string;

Folder that contains downloaded file or extracted files by untar or unzip

strip?: number;

Remove the specified number of leading path elements for untar only, default to 1.

etagAlgorithm?: string;

algorithm for check etag header with response data, used by crypto.createHash().

extract?: boolean | 'untar' | 'unzip';

If true, use untar for .tar.gz filename

onProgress?: (percent: string) => void;

Callback invoked with the download progress percent.

maxDownloadSize?: number;

Maximum number of compressed bytes accepted from the network. Defaults to 512 MiB.

maxExtractSize?: number;

Maximum total uncompressed archive size. Defaults to 1 GiB.

maxArchiveEntries?: number;

Maximum number of archive entries. Defaults to 100000.

Kind
interface
Declaration
typings/index.d.ts:7772
types

ResponseResult

Type alias exported by coc.nvim.

Source

Type definition

export type ResponseResult = string | Buffer | {
    [name: string]: any;
};
Kind
type alias
Declaration
typings/index.d.ts:7807
types

ExecOptions

Interface exported by coc.nvim.

Source

Interface definition

interface ExecOptions {
    cwd?: string;
    env?: NodeJS.ProcessEnv;
    shell?: string;
    timeout?: number;
    maxBuffer?: number;
    killSignal?: string;
    uid?: number;
    gid?: number;
    windowsHide?: boolean;
    encoding?: string;
}

Members

cwd?: string;

Current working directory of the process.

env?: NodeJS.ProcessEnv;

Environment variables of the process.

shell?: string;

Shell used to run the command.

timeout?: number;

Timeout in milliseconds.

maxBuffer?: number;

Max buffer size of stdout.

killSignal?: string;

Signal used to kill the process on timeout.

uid?: number;

User id of the process.

gid?: number;

Group id of the process.

windowsHide?: boolean;

Hide the window on Windows when true.

encoding?: string;

Encoding used to decode stdout, default to 'utf8'.

Kind
interface
Declaration
typings/index.d.ts:7841
types

FileType

Type of a file or directory.

Source

Enum definition

export enum FileType {
    Unknown = 0,
    File = 1,
    Directory = 2,
    SymbolicLink = 64
}

Members

Unknown = 0

The file type is unknown.

File = 1

A regular file.

Directory = 2

A directory.

SymbolicLink = 64

A symbolic link to a file.

Kind
enum
Declaration
typings/index.d.ts:7940
types

CommandItem

Interface exported by coc.nvim.

Source

Interface definition

export interface CommandItem {
    id: string;
    internal?: boolean;
    execute(...args: any[]): any;
}

Members

id: string;

Unique id of the command.

internal?: boolean;

Internal command, not shown in lists.

execute(...args: any[]): any;

Execute the command handler.

Kind
interface
Declaration
typings/index.d.ts:7961
types

EventResult

Type alias exported by coc.nvim.

Source

Type definition

type EventResult = void | Promise<void>;
Kind
type alias
Declaration
typings/index.d.ts:8101
types

MoveEvents

Type alias exported by coc.nvim.

Source

Type definition

type MoveEvents = 'CursorMoved' | 'CursorMovedI';
Kind
type alias
Declaration
typings/index.d.ts:8102
types

HoldEvents

Type alias exported by coc.nvim.

Source

Type definition

type HoldEvents = 'CursorHold' | 'CursorHoldI';
Kind
type alias
Declaration
typings/index.d.ts:8103
types

BufEvents

Type alias exported by coc.nvim.

Source

Type definition

type BufEvents = 'BufHidden' | 'BufEnter' | 'BufWritePost' | 'InsertLeave' | 'TermOpen' | 'InsertEnter' | 'BufCreate' | 'BufUnload' | 'BufWritePre' | 'Enter';
Kind
type alias
Declaration
typings/index.d.ts:8104
types

EmptyEvents

Type alias exported by coc.nvim.

Source

Type definition

type EmptyEvents = 'FocusGained' | 'FocusLost' | 'InsertSnippet';
Kind
type alias
Declaration
typings/index.d.ts:8107
types

InsertChangeEvents

Type alias exported by coc.nvim.

Source

Type definition

type InsertChangeEvents = 'TextChangedP' | 'TextChangedI';
Kind
type alias
Declaration
typings/index.d.ts:8108
types

TaskEvents

Type alias exported by coc.nvim.

Source

Type definition

type TaskEvents = 'TaskExit' | 'TaskStderr' | 'TaskStdout';
Kind
type alias
Declaration
typings/index.d.ts:8109
types

WindowEvents

Type alias exported by coc.nvim.

Source

Type definition

type WindowEvents = 'WinLeave' | 'WinEnter' | 'WinClosed';
Kind
type alias
Declaration
typings/index.d.ts:8110
types

AllEvents

Type alias exported by coc.nvim.

Source

Type definition

type AllEvents = BufEvents | EmptyEvents | HoldEvents | MoveEvents | TaskEvents | WindowEvents | InsertChangeEvents | 'CompleteDone' | 'TextChanged' | 'MenuPopupChanged' | 'InsertCharPre' | 'FileType' | 'BufWinEnter' | 'BufWinLeave' | 'VimResized' | 'DirChanged' | 'OptionSet' | 'Command' | 'BufReadCmd' | 'GlobalChange' | 'InputChar' | 'WinLeave' | 'MenuInput' | 'PromptInsert' | 'FloatBtnClick' | 'InsertSnippet' | 'PromptKeyPress' | 'WinScrolled' | 'WindowVisible';
Kind
type alias
Declaration
typings/index.d.ts:8111
types

OptionValue

Type alias exported by coc.nvim.

Source

Type definition

type OptionValue = string | number | boolean;
Kind
type alias
Declaration
typings/index.d.ts:8112
types

PromptWidowKeys

Type alias exported by coc.nvim.

Source

Type definition

type PromptWidowKeys = 'C-j' | 'C-k' | 'C-n' | 'C-p' | 'up' | 'down';
Kind
type alias
Declaration
typings/index.d.ts:8113
types

CursorPosition

Interface exported by coc.nvim.

Source

Interface definition

export interface CursorPosition {
    readonly bufnr: number;
    readonly lnum: number;
    readonly col: number;
    readonly insert: boolean;
}

Members

readonly bufnr: number;

Buffer number.

readonly lnum: number;

Line number, 1 based.

readonly col: number;

Column number, 1 based.

readonly insert: boolean;

Whether the cursor is in insert mode.

Kind
interface
Declaration
typings/index.d.ts:8115
types

InsertChange

Interface exported by coc.nvim.

Source

Interface definition

export interface InsertChange {
    readonly lnum: number;
    readonly col: number;
    readonly pre: string;
    readonly insertChar: string | undefined;
    readonly changedtick: number;
}

Members

readonly lnum: number;

1 based line number

readonly col: number;

1 based column number

readonly pre: string;

Text before cursor.

readonly insertChar: string | undefined;

Insert character that cause change of this time.

readonly changedtick: number;

Changedtick of the buffer.

Kind
interface
Declaration
typings/index.d.ts:8134
types

PopupChangeEvent

Interface exported by coc.nvim.

Source

Interface definition

export interface PopupChangeEvent {
    readonly index: number;
    readonly word: string;
    readonly height: number;
    readonly width: number;
    readonly row: number;
    readonly col: number;
    readonly size: number;
    readonly scrollbar: boolean;
    readonly inserted: boolean;
    readonly move: boolean;
}

Members

readonly index: number;

0 based index of item in the list.

readonly word: string;

Word of item.

readonly height: number;

Height of pum.

readonly width: number;

Width of pum.

readonly row: number;

Screen row of pum.

readonly col: number;

Screen col of pum.

readonly size: number;

Total length of completion list.

readonly scrollbar: boolean;

Scollbar in the pum.

readonly inserted: boolean;

Word is inserted.

readonly move: boolean;

Caused by selection change (not initial or completed)

Kind
interface
Declaration
typings/index.d.ts:8157
types

VisibleEvent

Interface exported by coc.nvim.

Source

Interface definition

export interface VisibleEvent {
    winid: number;
    bufnr: number;
    region: [
        number,
        number
    ];
}

Members

winid: number;

Window id.

bufnr: number;

Buffer number.

region: [ number, number ];

1 based, end inclusive topline, botline

Kind
interface
Declaration
typings/index.d.ts:8200
types

FileCreateEvent

An event that is fired after files are created.

Source

Interface definition

export interface FileCreateEvent {
    readonly files: ReadonlyArray<Uri>;
}

Members

readonly files: ReadonlyArray<Uri>;

The files that got created.

Kind
interface
Declaration
typings/index.d.ts:8337
types

FileWillCreateEvent

An event that is fired when files are going to be created.

To make modifications to the workspace before the files are created, call the `waitUntil-function with a thenable that resolves to a workspace edit.

Source

Interface definition

export interface FileWillCreateEvent {
    readonly token: CancellationToken;
    readonly files: ReadonlyArray<Uri>;
    waitUntil(thenable: Thenable<WorkspaceEdit | any>): void;
}

Members

readonly token: CancellationToken;

A cancellation token.

readonly files: ReadonlyArray<Uri>;

The files that are going to be created.

waitUntil(thenable: Thenable<WorkspaceEdit | any>): void;

Allows to pause the event and to apply a workspace edit.

Note: This function can only be called during event dispatch and not in an asynchronous manner:

workspace.onWillCreateFiles(event => {
    // async, will *throw* an error
    setTimeout(() => event.waitUntil(promise));

    // sync, OK
    event.waitUntil(promise);
})
Kind
interface
Declaration
typings/index.d.ts:8352
types

FileWillDeleteEvent

An event that is fired when files are going to be deleted.

To make modifications to the workspace before the files are deleted, call the `waitUntil-function with a thenable that resolves to a workspace edit.

Source

Interface definition

export interface FileWillDeleteEvent {
    readonly files: ReadonlyArray<Uri>;
    waitUntil(thenable: Thenable<WorkspaceEdit | any>): void;
}

Members

readonly files: ReadonlyArray<Uri>;

The files that are going to be deleted.

waitUntil(thenable: Thenable<WorkspaceEdit | any>): void;

Allows to pause the event and to apply a workspace edit.

Note: This function can only be called during event dispatch and not in an asynchronous manner:

workspace.onWillCreateFiles(event => {
    // async, will *throw* an error
    setTimeout(() => event.waitUntil(promise));

    // sync, OK
    event.waitUntil(promise);
})
Kind
interface
Declaration
typings/index.d.ts:8392
types

FileDeleteEvent

An event that is fired after files are deleted.

Source

Interface definition

export interface FileDeleteEvent {
    readonly files: ReadonlyArray<Uri>;
}

Members

readonly files: ReadonlyArray<Uri>;

The files that got deleted.

Kind
interface
Declaration
typings/index.d.ts:8423
types

FileRenameEvent

An event that is fired after files are renamed.

Source

Interface definition

export interface FileRenameEvent {
    readonly files: ReadonlyArray<{
        oldUri: Uri;
        newUri: Uri;
    }>;
}

Members

readonly files: ReadonlyArray<{ oldUri: Uri; newUri: Uri; }>;

The files that got renamed.

Kind
interface
Declaration
typings/index.d.ts:8434
types

FileWillRenameEvent

An event that is fired when files are going to be renamed.

To make modifications to the workspace before the files are renamed, call the `waitUntil-function with a thenable that resolves to a workspace edit.

Source

Interface definition

export interface FileWillRenameEvent {
    readonly files: ReadonlyArray<{
        oldUri: Uri;
        newUri: Uri;
    }>;
    waitUntil(thenable: Thenable<WorkspaceEdit | any>): void;
}

Members

readonly files: ReadonlyArray<{ oldUri: Uri; newUri: Uri; }>;

The files that are going to be renamed.

waitUntil(thenable: Thenable<WorkspaceEdit | any>): void;

Allows to pause the event and to apply a workspace edit.

Note: This function can only be called during event dispatch and not in an asynchronous manner:

workspace.onWillCreateFiles(event => {
	// async, will *throw* an error
	setTimeout(() => event.waitUntil(promise));

	// sync, OK
	event.waitUntil(promise);
})
Kind
interface
Declaration
typings/index.d.ts:8449
types

DocumentSymbolProviderMetadata

Interface exported by coc.nvim.

Source

Interface definition

export interface DocumentSymbolProviderMetadata {
    label?: string;
}

Members

label?: string;

A human-readable string that is shown when multiple outlines trees show for one document.

Kind
interface
Declaration
typings/index.d.ts:8479
types

ServiceStat

Enum exported by coc.nvim.

Source

Enum definition

export enum ServiceStat {
    Initial,
    Starting,
    StartFailed,
    Running,
    Stopping,
    Stopped
}

Members

Initial
Starting
StartFailed
Running
Stopping
Stopped
Kind
enum
Declaration
typings/index.d.ts:8886
types

IServiceProvider

Interface exported by coc.nvim.

Source

Interface definition

export interface IServiceProvider {
    id: string;
    name: string;
    client?: LanguageClient;
    selector: DocumentSelector;
    state: ServiceStat;
    start(): Promise<void>;
    dispose(): void;
    stop(): Promise<void> | void;
    restart(): Promise<void> | void;
    onServiceReady: Event<void>;
}

Members

id: string;

Unique service id.

name: string;

Name of the service.

client?: LanguageClient;

Language client of the service.

selector: DocumentSelector;

Document selector of the service.

state: ServiceStat;

Current state of the service.

start(): Promise<void>;

Start the service.

dispose(): void;

Dispose the service.

stop(): Promise<void> | void;

Stop the service.

restart(): Promise<void> | void;

Restart the service.

onServiceReady: Event<void>;

Fired when the service is ready.

Kind
interface
Declaration
typings/index.d.ts:8895
types

SourceConfig

Source options to create source that could respect configuration from coc.source.{name}

Source

Interface definition

export interface SourceConfig {
    name: string;
    triggerOnly?: boolean;
    isSnippet?: boolean;
    sourceType?: SourceType;
    filepath?: string;
    documentSelector?: DocumentSelector;
    firstMatch?: boolean;
    refresh?(): Promise<void>;
    toggle?(): void;
    onEnter?(bufnr: number): void;
    shouldComplete?(opt: CompleteOption): ProviderResult<boolean>;
    doComplete(opt: CompleteOption, token: CancellationToken): ProviderResult<CompleteResult>;
    onCompleteResolve?(item: VimCompleteItem, opt: CompleteOption, token: CancellationToken): ProviderResult<void>;
    onCompleteDone?(item: VimCompleteItem, opt: CompleteOption, snippetsSupport?: boolean): ProviderResult<void>;
    shouldCommit?(item: VimCompleteItem, character: string): boolean;
}

Members

name: string;

Unique name of the source.

triggerOnly?: boolean;

Only complete when triggered.

isSnippet?: boolean;

Items of the source are snippets.

sourceType?: SourceType;

Type of the source.

filepath?: string;

Filepath of the source script.

documentSelector?: DocumentSelector;

Document selector of the source.

firstMatch?: boolean;

Only the first match should be used.

refresh?(): Promise<void>;

Refresh the source.

toggle?(): void;

Toggle the source.

onEnter?(bufnr: number): void;

Called on buffer enter.

shouldComplete?(opt: CompleteOption): ProviderResult<boolean>;

Check whether the source should complete.

doComplete(opt: CompleteOption, token: CancellationToken): ProviderResult<CompleteResult>;

Invoke completion of the source.

onCompleteResolve?(item: VimCompleteItem, opt: CompleteOption, token: CancellationToken): ProviderResult<void>;

Called when a completion item is resolved.

onCompleteDone?(item: VimCompleteItem, opt: CompleteOption, snippetsSupport?: boolean): ProviderResult<void>;

Called when a completion item is confirmed.

shouldCommit?(item: VimCompleteItem, character: string): boolean;

Check whether completion should commit with the character.

Kind
interface
Declaration
typings/index.d.ts:8974
types

SourceStat

Interface exported by coc.nvim.

Source

Interface definition

export interface SourceStat {
    name: string;
    priority: number;
    triggerCharacters: string[];
    type: 'native' | 'remote' | 'service';
    shortcut: string;
    filepath: string;
    disabled: boolean;
    filetypes: string[];
}

Members

name: string;

Name of the source.

priority: number;

Priority of the source.

triggerCharacters: string[];

Trigger characters of the source.

type: 'native' | 'remote' | 'service';

Type of the source.

shortcut: string;

Shortcut of the source.

filepath: string;

Filepath of the source.

disabled: boolean;

Whether the source is disabled.

filetypes: string[];

Filetypes the source works on.

Kind
interface
Declaration
typings/index.d.ts:9037
types

SourceType

Enum exported by coc.nvim.

Source

Enum definition

export enum SourceType {
    Native,
    Remote,
    Service
}

Members

Native
Remote
Service
Kind
enum
Declaration
typings/index.d.ts:9072
types

CompleteResult

Interface exported by coc.nvim.

Source

Interface definition

export interface CompleteResult {
    items: ReadonlyArray<VimCompleteItem>;
    isIncomplete?: boolean;
    startcol?: number;
}

Members

items: ReadonlyArray<VimCompleteItem>;

List of completion items.

isIncomplete?: boolean;

The completion list is incomplete when true.

startcol?: number;

Start column of the completion, 0 based.

Kind
interface
Declaration
typings/index.d.ts:9078
types

CompleteOption

Interface exported by coc.nvim.

Source

Interface definition

export interface CompleteOption {
    readonly bufnr: number;
    readonly line: string;
    readonly col: number;
    readonly input: string;
    readonly filetype: string;
    readonly filepath: string;
    readonly word: string;
    readonly triggerCharacter?: string;
    readonly colnr: number;
    readonly linenr: number;
    readonly position: Position;
    readonly synname: string;
    readonly changedtick: number;
    readonly triggerForInComplete?: boolean;
}

Members

readonly bufnr: number;

Current buffer number.

readonly line: string;

Current line.

readonly col: number;

Column to start completion, determined by iskeyword options of buffer.

readonly input: string;

Input text.

readonly filetype: string;

Filetype of the current buffer.

readonly filepath: string;

Filepath of the current buffer.

readonly word: string;

Word under cursor.

readonly triggerCharacter?: string;

Trigger character, could be undefined.

readonly colnr: number;

Col of cursor, 1 based.

readonly linenr: number;

Line number of the cursor, 1 based.

readonly position: Position;

Position of cursor when trigger completion

readonly synname: string;

Syntax name at the cursor position.

readonly changedtick: number;

Buffer changetick

readonly triggerForInComplete?: boolean;

Is trigger for in complete completion.

Kind
interface
Declaration
typings/index.d.ts:9094
types

ISource

Interface exported by coc.nvim.

Source

Interface definition

export interface ISource {
    name: string;
    filetypes?: string[];
    documentSelector?: DocumentSelector;
    enable?: boolean;
    shortcut?: string;
    priority?: number;
    sourceType?: SourceType;
    triggerOnly?: boolean;
    triggerCharacters?: string[];
    triggerPatterns?: RegExp[];
    disableSyntaxes?: string[];
    filepath?: string;
    firstMatch?: boolean;
    refresh?(): Promise<void>;
    toggle?(): void;
    onEnter?(bufnr: number): void;
    shouldComplete?(opt: CompleteOption): ProviderResult<boolean>;
    doComplete(opt: CompleteOption, token: CancellationToken): ProviderResult<CompleteResult>;
    onCompleteResolve?(item: VimCompleteItem, token: CancellationToken): ProviderResult<void>;
    onCompleteDone?(item: VimCompleteItem, opt: CompleteOption): ProviderResult<void>;
    shouldCommit?(item: VimCompleteItem, character: string): boolean;
}

Members

name: string;

Identifier name

filetypes?: string[];
documentSelector?: DocumentSelector;

Filters of document.

enable?: boolean;

Whether the source is enabled, default to true.

shortcut?: string;

Shortcut shown in the completion menu.

priority?: number;

Priority of the source.

sourceType?: SourceType;

Type of the source.

triggerOnly?: boolean;

Should only be used when completion is triggered, requires triggerPatterns or triggerCharacters defined.

triggerCharacters?: string[];

Trigger completion when the user types one of the characters.

triggerPatterns?: RegExp[];

Regex to detect trigger completion, ignored when triggerCharacters exists.

disableSyntaxes?: string[];

Syntaxes that disable the source.

filepath?: string;

Filepath of the source.

firstMatch?: boolean;

Whether the first character should always match.

refresh?(): Promise<void>;

Refresh the source.

toggle?(): void;

For disable/enable

onEnter?(bufnr: number): void;

Triggered on BufEnter, used for cache normally

shouldComplete?(opt: CompleteOption): ProviderResult<boolean>;

Check if this source should doComplete

doComplete(opt: CompleteOption, token: CancellationToken): ProviderResult<CompleteResult>;

Invoke completion

onCompleteResolve?(item: VimCompleteItem, token: CancellationToken): ProviderResult<void>;

Action for complete item on complete item selected

onCompleteDone?(item: VimCompleteItem, opt: CompleteOption): ProviderResult<void>;

Action for complete item on complete done

shouldCommit?(item: VimCompleteItem, character: string): boolean;

Check whether completion should commit with the character.

Kind
interface
Declaration
typings/index.d.ts:9153
types

TreeItemLabel

Interface exported by coc.nvim.

Source

Interface definition

export interface TreeItemLabel {
    label: string;
    highlights?: [
        number,
        number
    ][];
}

Members

label: string;

Text of the label.

highlights?: [ number, number ][];

Ranges of highlights, 0 based.

Kind
interface
Declaration
typings/index.d.ts:9318
types

TreeItemIcon

Interface exported by coc.nvim.

Source

Interface definition

export interface TreeItemIcon {
    text: string;
    hlGroup: string;
}

Members

text: string;

Text of the icon.

hlGroup: string;

Highlight group of the icon.

Kind
interface
Declaration
typings/index.d.ts:9329
types

TreeItemCollapsibleState

Collapsible state of the tree item

Source

Enum definition

export enum TreeItemCollapsibleState {
    None = 0,
    Collapsed = 1,
    Expanded = 2
}

Members

None = 0

Determines an item can be neither collapsed nor expanded. Implies it has no children.

Collapsed = 1

Determines an item is collapsed

Expanded = 2

Determines an item is expanded

Kind
enum
Declaration
typings/index.d.ts:9343
types

TreeItem

Class exported by coc.nvim.

Source

Class definition

export class TreeItem {
    label: string | TreeItemLabel;
    description?: string;
    icon?: TreeItemIcon;
    id?: string;
    resourceUri?: Uri;
    tooltip?: string | MarkupContent;
    command?: Command;
    deprecated?: boolean;
    collapsibleState?: TreeItemCollapsibleState;
    constructor(label: string | TreeItemLabel, collapsibleState?: TreeItemCollapsibleState);
    constructor(resourceUri: Uri, collapsibleState?: TreeItemCollapsibleState);
}

Members

label: string | TreeItemLabel;

A human-readable string describing this item. When falsy, it is derived from resourceUri.

description?: string;

Description rendered less prominently after label.

icon?: TreeItemIcon;

The icon path or theme icon for the tree item. When falsy, the folder theme icon is assigned if the item is collapsible, otherwise the file theme icon. When a file or folder theme icon is specified, the icon is derived from the current file icon theme using resourceUri (if provided).

id?: string;

Optional id for the tree item that has to be unique across tree. The id is used to preserve the selection and expansion state of the tree item.

If not provided, an id is generated using the tree item's resourceUri when exists. Note that when labels change, ids will change and that selection and expansion state cannot be kept stable anymore.

resourceUri?: Uri;

The of the resource representing this item.

Will be used to derive the label, when it is not provided. Will be used to derive the icon from the current file icon theme, when icon has a theme icon value.

tooltip?: string | MarkupContent;

The tooltip text when you hover over this item.

command?: Command;

The that should be executed when the tree item is selected.

Please use vscode.open or vscode.diff as command IDs when the tree item is opening something in the editor. Using these commands ensures that the resulting editor will appear consistent with how other built-in trees open editors.

deprecated?: boolean;

Whether the tree item is deprecated.

collapsibleState?: TreeItemCollapsibleState;

of the tree item.

constructor(label: string | TreeItemLabel, collapsibleState?: TreeItemCollapsibleState);
constructor(resourceUri: Uri, collapsibleState?: TreeItemCollapsibleState);
Kind
class
Declaration
typings/index.d.ts:9358
types

TreeItemAction

Action resolved by

Source

Interface definition

export interface TreeItemAction<T> {
    title: string;
    handler: (item: T) => ProviderResult<void>;
}

Members

title: string;

Label text in menu.

handler: (item: T) => ProviderResult<void>;

Handler of the action.

Kind
interface
Declaration
typings/index.d.ts:9431
types

TreeViewOptions

Options for creating a

Source

Interface definition

export interface TreeViewOptions<T> {
    bufhidden?: 'hide' | 'unload' | 'delete' | 'wipe';
    winfixwidth?: boolean;
    enableFilter?: boolean;
    disableLeafIndent?: boolean;
    treeDataProvider: TreeDataProvider<T>;
    canSelectMany?: boolean;
}

Members

bufhidden?: 'hide' | 'unload' | 'delete' | 'wipe';

bufhidden option for TreeView, default to 'wipe'

winfixwidth?: boolean;

Fixed width for window, default to true

enableFilter?: boolean;

Enable filter feature, default to false

disableLeafIndent?: boolean;

Disable indent of leaves without children, default to false

treeDataProvider: TreeDataProvider<T>;

A data provider that provides tree data.

canSelectMany?: boolean;

Whether the tree supports multi-select. When the tree supports multi-select and a command is executed from the tree, the first argument to the command is the tree item that the command was executed on and the second argument is an array containing all selected tree items.

Kind
interface
Declaration
typings/index.d.ts:9445
types

TreeViewExpansionEvent

The event that is fired when an element in the is expanded or collapsed

Source

Interface definition

export interface TreeViewExpansionEvent<T> {
    readonly element: T;
}

Members

readonly element: T;

Element that is expanded or collapsed.

Kind
interface
Declaration
typings/index.d.ts:9477
types

TreeViewSelectionChangeEvent

The event that is fired when there is a change in tree view's selection

Source

Interface definition

export interface TreeViewSelectionChangeEvent<T> {
    readonly selection: T[];
}

Members

readonly selection: T[];

Selected elements.

Kind
interface
Declaration
typings/index.d.ts:9489
types

TreeViewVisibilityChangeEvent

The event that is fired when there is a change in tree view's visibility

Source

Interface definition

export interface TreeViewVisibilityChangeEvent {
    readonly visible: boolean;
}

Members

readonly visible: boolean;

true if the tree view is visible otherwise false.

Kind
interface
Declaration
typings/index.d.ts:9501
types

TreeView

Represents a Tree view

Source

Interface definition

export interface TreeView<T> extends Disposable {
    readonly onDidExpandElement: Event<TreeViewExpansionEvent<T>>;
    readonly onDidCollapseElement: Event<TreeViewExpansionEvent<T>>;
    readonly selection: T[];
    readonly onDidChangeSelection: Event<TreeViewSelectionChangeEvent<T>>;
    readonly onDidChangeVisibility: Event<TreeViewVisibilityChangeEvent>;
    readonly visible: boolean;
    readonly windowId: number | undefined;
    message?: string;
    title?: string;
    description?: string;
    reveal(element: T, options?: {
        select?: boolean;
        focus?: boolean;
        expand?: boolean | number;
    }): Thenable<void>;
    show(splitCommand?: string): Promise<boolean>;
}

Members

readonly onDidExpandElement: Event<TreeViewExpansionEvent<T>>;

Event that is fired when an element is expanded

readonly onDidCollapseElement: Event<TreeViewExpansionEvent<T>>;

Event that is fired when an element is collapsed

readonly selection: T[];

Currently selected elements.

readonly onDidChangeSelection: Event<TreeViewSelectionChangeEvent<T>>;

Event that is fired when the selection has changed

readonly onDidChangeVisibility: Event<TreeViewVisibilityChangeEvent>;

Event that is fired when visibility has changed

readonly visible: boolean;

true if the tree view is visible otherwise false.

NOTE: is true when TreeView visible on other tab.

readonly windowId: number | undefined;

Window id used by TreeView.

message?: string;

An optional human-readable message that will be rendered in the view. Setting the message to null, undefined, or empty string will remove the message from the view.

title?: string;

The tree view title is initially taken from viewId of TreeView Changes to the title property will be properly reflected in the UI in the title of the view.

description?: string;

An optional human-readable description which is rendered less prominently in the title of the view. Setting the title description to null, undefined, or empty string will remove the description from the view.

reveal(element: T, options?: { select?: boolean; focus?: boolean; expand?: boolean | number; }): Thenable<void>;

Reveals the given element in the tree view. If the tree view is not visible then the tree view is shown and element is revealed.

By default revealed element is selected. In order to not to select, set the option select to false. In order to focus, set the option focus to true. In order to expand the revealed element, set the option expand to true. To expand recursively set expand to the number of levels to expand. NOTE: You can expand only to 3 levels maximum.

NOTE: The that the TreeView is registered with with must implement getParent method to access this API.

show(splitCommand?: string): Promise<boolean>;

Create tree view in new window.

NOTE: TreeView with same viewId in current tab would be disposed.

Kind
interface
Declaration
typings/index.d.ts:9513
types

TreeDataProvider

A data provider that provides tree data

Source

Interface definition

export interface TreeDataProvider<T> {
    onDidChangeTreeData?: Event<T | undefined | null | void>;
    getTreeItem(element: T): TreeItem | Thenable<TreeItem>;
    getChildren(element?: T): ProviderResult<T[]>;
    getParent?(element: T): ProviderResult<T>;
    resolveTreeItem?(item: TreeItem, element: T, token: CancellationToken): ProviderResult<TreeItem>;
    resolveActions?(item: TreeItem, element: T): ProviderResult<TreeItemAction<T>[]>;
}

Members

onDidChangeTreeData?: Event<T | undefined | null | void>;

An optional event to signal that an element or root has changed. This will trigger the view to update the changed element/root and its children recursively (if shown). To signal that root has changed, do not pass any argument or pass undefined or null.

getTreeItem(element: T): TreeItem | Thenable<TreeItem>;

Get representation of the element

getChildren(element?: T): ProviderResult<T[]>;

Get the children of element or root if no element is passed.

getParent?(element: T): ProviderResult<T>;

Optional method to return the parent of element. Return null or undefined if element is a child of root.

NOTE: This method should be implemented in order to access reveal API.

resolveTreeItem?(item: TreeItem, element: T, token: CancellationToken): ProviderResult<TreeItem>;

Called on hover to resolve the TreeItem property if it is undefined. Called on tree item click/open to resolve the TreeItem property if it is undefined. Only properties that were undefined can be resolved in resolveTreeItem. Functionality may be expanded later to include being called to resolve other missing properties on selection and/or on open.

Will only ever be called once per TreeItem.

onDidChangeTreeData should not be triggered from within resolveTreeItem.

Note that this function is called when tree items are already showing in the UI. Because of that, no property that changes the presentation (label, description, etc.) can be changed.

resolveActions?(item: TreeItem, element: T): ProviderResult<TreeItemAction<T>[]>;

Called with current element to resolve actions. Called when user press 'actions' key.

Kind
interface
Declaration
typings/index.d.ts:9598
types

ConfigurationChangeEvent

An event describing the change in Configuration

Source

Interface definition

export interface ConfigurationChangeEvent {
    affectsConfiguration(section: string, scope?: ConfigurationScope): boolean;
}

Members

affectsConfiguration(section: string, scope?: ConfigurationScope): boolean;

Returns true if the given section for the given resource (if provided) is affected.

Kind
interface
Declaration
typings/index.d.ts:9671
types

WillSaveEvent

Interface exported by coc.nvim.

Source

Interface definition

export interface WillSaveEvent extends TextDocumentWillSaveEvent {
    waitUntil(thenable: Thenable<TextEdit[] | any>): void;
}

Members

waitUntil(thenable: Thenable<TextEdit[] | any>): void;

Allows to pause the event loop and to apply pre-save-edits. Edits of subsequent calls to this function will be applied in order. The edits will be ignored if concurrent modifications of the document happened.

Note: This function can only be called during event dispatch and not in an asynchronous manner:

workspace.onWillSaveTextDocument(event => {
	// async, will *throw* an error
	setTimeout(() => event.waitUntil(promise));

	// sync, OK
	event.waitUntil(promise);
})
Kind
interface
Declaration
typings/index.d.ts:9683
types

KeymapOption

Interface exported by coc.nvim.

Source

Interface definition

export interface KeymapOption {
    cmd?: boolean;
    sync?: boolean;
    cancel?: boolean;
    silent?: boolean;
    repeat?: boolean;
    special?: boolean;
}

Members

cmd?: boolean;

Use <Cmd> as rhs command prefix, ignored on insert mode (<expr> is used on insert mode), see :h map-cmd.

sync?: boolean;

When invoke the callback, send request to NodeJS instead of notification, default true.

cancel?: boolean;

Cancel completion before invoke callback, default true, insert mode only.

silent?: boolean;

Use <silent> for keymap, default true.

repeat?: boolean;

Enable repeat support for repeat.vim, default false.

special?: boolean;

Use <special> map argument, see :h :map-special, vim9 only.

Kind
interface
Declaration
typings/index.d.ts:9707
types

DidChangeTextDocumentParams

Interface exported by coc.nvim.

Source

Interface definition

export interface DidChangeTextDocumentParams {
    readonly textDocument: {
        version: number;
        uri: string;
    };
    readonly document: LinesTextDocument;
    readonly contentChanges: ReadonlyArray<TextDocumentContentChange>;
    readonly bufnr: number;
    readonly original: string;
    readonly originalLines: ReadonlyArray<string>;
}

Members

readonly textDocument: { version: number; uri: string; };

The document that did change. The version number points to the version after all provided content changes have been applied.

readonly document: LinesTextDocument;

The affected document.

readonly contentChanges: ReadonlyArray<TextDocumentContentChange>;

The actual content changes. The content changes describe single state changes to the document. So if there are two content changes c1 (at array index 0) and c2 (at array index 1) for a document in state S then c1 moves the document from S to S' and c2 from S' to S''. So c1 is computed on the state S and c2 is computed on the state S'.

readonly bufnr: number;

Buffer number of document.

readonly original: string;

Original content before change

readonly originalLines: ReadonlyArray<string>;

Original lines before change

Kind
interface
Declaration
typings/index.d.ts:9734
types

MapMode

Type alias exported by coc.nvim.

Source

Type definition

export type MapMode = 'n' | 'i' | 'v' | 'x' | 's' | 'o' | '!' | 't' | 'c' | 'l';
Kind
type alias
Declaration
typings/index.d.ts:9781
types

Autocmd

Interface exported by coc.nvim.

Source

Interface definition

export interface Autocmd {
    event: string | string[];
    callback: (...args: any[]) => void | Promise<void>;
    pattern?: string | string[];
    arglist?: string[];
    buffer?: number;
    once?: boolean;
    nested?: boolean;
    request?: boolean;
    thisArg?: any;
}

Members

event: string | string[];

Vim event or event set.

callback: (...args: any[]) => void | Promise<void>;

Callback functions that called with evaled arglist as arguments.

pattern?: string | string[];

Match pattern, default to *.

arglist?: string[];

Vim expression that eval to arguments of callback, default to []

buffer?: number;

buffer number for buffer-local autocommand.

once?: boolean;

the command is executed once when true, see :h autocmd-once

nested?: boolean;

allow nested autocmd when true, see :h autocmd-nested

request?: boolean;

Use request when true, use notification by default.

thisArg?: any;

this of callback.

Kind
interface
Declaration
typings/index.d.ts:9783
types

Env

Interface exported by coc.nvim.

Source

Interface definition

export interface Env {
    readonly runtimepath: string;
    readonly virtualText: boolean;
    readonly guicursor: string;
    readonly floating: boolean;
    readonly sign: boolean;
    readonly extensionRoot: string;
    readonly pid: number;
    readonly columns: number;
    readonly lines: number;
    readonly pumevent: boolean;
    readonly cmdheight: number;
    readonly filetypeMap: {
        [index: string]: string;
    };
    readonly isVim: boolean;
    readonly isCygwin: boolean;
    readonly isMacvim: boolean;
    readonly isiTerm: boolean;
    readonly version: string;
    readonly progpath: string;
    readonly dialog: boolean;
    readonly terminal: boolean;
    readonly textprop: boolean;
}

Members

readonly runtimepath: string;

|runtimepath| option of (neo)vim.

readonly virtualText: boolean;

|virtualText| support in (neo)vim

readonly guicursor: string;

|guicursor| option of (neo)vim

readonly floating: boolean;

Could use float window on neovim, always false on vim.

readonly sign: boolean;

|sign_place()| and |sign_unplace()| can be used when true.

readonly extensionRoot: string;

Root directory of extensions.

readonly pid: number;

Process id of (neo)vim.

readonly columns: number;

Total columns of screen.

readonly lines: number;

Total lines of screen.

readonly pumevent: boolean;

Is true when |CompleteChanged| event is supported.

readonly cmdheight: number;

|cmdheight| option of (neo)vim.

readonly filetypeMap: { [index: string]: string; };

Value of |g:coc_filetype_map|

readonly isVim: boolean;

Is true when not using neovim.

readonly isCygwin: boolean;

Is cygvim when true.

readonly isMacvim: boolean;

Is macvim when true.

readonly isiTerm: boolean;

Is true when iTerm.app is used on mac.

readonly version: string;

version of (neo)vim, on vim it's like: 8020750, on neoivm it's like

readonly progpath: string;

|v:progpath| value, could be empty.

readonly dialog: boolean;

Is true when dialog feature is supported

readonly terminal: boolean;

Is true when terminal feature is supported

readonly textprop: boolean;

Is true when vim's textprop is supported.

Kind
interface
Declaration
typings/index.d.ts:9822
types

Mru

Store & retrieve most recent used items.

Source

Class definition

export class Mru {
    constructor(name: string, base?: string, maximum?: number);
    load(): Promise<string[]>;
    loadSync(): string[];
    add(item: string): Promise<void>;
    remove(item: string): Promise<void>;
    clean(): Promise<void>;
}

Members

constructor(name: string, base?: string, maximum?: number);
load(): Promise<string[]>;

Load iems from mru file

loadSync(): string[];

Load lines from mru file synchronously.

add(item: string): Promise<void>;

Add item to mru file.

remove(item: string): Promise<void>;

Remove item from mru file.

clean(): Promise<void>;

Remove the data file.

Kind
class
Declaration
typings/index.d.ts:9912
types

TaskOptions

Option to create task that runs in (neo)vim.

Source

Interface definition

export interface TaskOptions {
    cmd: string;
    args?: string[];
    cwd?: string;
    env?: {
        [key: string]: string;
    };
    pty?: boolean;
    detach?: boolean;
}

Members

cmd: string;

The command to run, without arguments

args?: string[];

Arguments of command.

cwd?: string;

Current working directory of the task, Default to current vim's cwd.

env?: { [key: string]: string; };

Additional environment key-value pairs.

pty?: boolean;

Use pty when true.

detach?: boolean;

Detach child process when true.

Kind
interface
Declaration
typings/index.d.ts:9950
types

Task

Controls long running task started by (neo)vim. Useful to keep the task running after CocRestart.

Source

Interface definition

export interface Task extends Disposable {
    onExit: Event<number>;
    onStdout: Event<string[]>;
    onStderr: Event<string[]>;
    start(opts: TaskOptions): Promise<boolean>;
    stop(): Promise<void>;
    running: Promise<boolean>;
}

Members

onExit: Event<number>;

Fired on task exit with exit code.

onStdout: Event<string[]>;

Fired with lines on stdout received.

onStderr: Event<string[]>;

Fired with lines on stderr received.

start(opts: TaskOptions): Promise<boolean>;

Start task, task will be restarted when already running.

stop(): Promise<void>;

Stop task by SIGTERM or SIGKILL

running: Promise<boolean>;

Check if the task is running.

Kind
interface
Declaration
typings/index.d.ts:9981
types

JsonDB

A simple json database.

Source

Interface definition

export interface JsonDB {
    filepath: string;
    fetch(key: string): any;
    exists(key: string): boolean;
    delete(key: string): void;
    push(key: string, data: number | null | boolean | string | {
        [index: string]: any;
    }): void;
    clear(): void;
    destroy(): void;
}

Members

filepath: string;

Filepath of the database file.

fetch(key: string): any;

Get data by key.

exists(key: string): boolean;

Check if key exists

delete(key: string): void;

Delete data by key

push(key: string, data: number | null | boolean | string | { [index: string]: any; }): void;

Save data with key

clear(): void;

Empty db file.

destroy(): void;

Remove db file.

Kind
interface
Declaration
typings/index.d.ts:10014
types

RenameEvent

Interface exported by coc.nvim.

Source

Interface definition

export interface RenameEvent {
    oldUri: Uri;
    newUri: Uri;
}

Members

oldUri: Uri;

Old uri of the file.

newUri: Uri;

New uri of the file.

Kind
interface
Declaration
typings/index.d.ts:10052
types

FileSystemWatcher

Interface exported by coc.nvim.

Source

Interface definition

export interface FileSystemWatcher {
    readonly ignoreCreateEvents: boolean;
    readonly ignoreChangeEvents: boolean;
    readonly ignoreDeleteEvents: boolean;
    readonly onDidCreate: Event<Uri>;
    readonly onDidChange: Event<Uri>;
    readonly onDidDelete: Event<Uri>;
    readonly onDidRename: Event<RenameEvent>;
    dispose(): void;
}

Members

readonly ignoreCreateEvents: boolean;

Ignore create events when true.

readonly ignoreChangeEvents: boolean;

Ignore change events when true.

readonly ignoreDeleteEvents: boolean;

Ignore delete events when true.

readonly onDidCreate: Event<Uri>;

Fired when a file is created.

readonly onDidChange: Event<Uri>;

Fired when a file is changed.

readonly onDidDelete: Event<Uri>;

Fired when a file is deleted.

readonly onDidRename: Event<RenameEvent>;

Fired when a file is renamed.

dispose(): void;

Dispose the watcher.

Kind
interface
Declaration
typings/index.d.ts:10063
types

ConfigurationInspect

Interface exported by coc.nvim.

Source

Interface definition

export interface ConfigurationInspect<T> {
    key: string;
    defaultValue?: T;
    globalValue?: T;
    workspaceValue?: T;
    workspaceFolderValue?: T;
}

Members

key: string;

Key of the configuration.

defaultValue?: T;

Default value of the configuration.

globalValue?: T;

Global value of the configuration.

workspaceValue?: T;

Workspace value of the configuration.

workspaceFolderValue?: T;

Workspace folder value of the configuration.

Kind
interface
Declaration
typings/index.d.ts:10100
types

WorkspaceConfiguration

Interface exported by coc.nvim.

Source

Interface definition

export interface WorkspaceConfiguration {
    get<T>(section: string): T | undefined;
    get<T>(section: string, defaultValue: T): T;
    has(section: string): boolean;
    inspect<T>(section: string): ConfigurationInspect<T> | undefined;
    update(section: string, value: any, updateTarget?: ConfigurationTarget | boolean): Thenable<void>;
    readonly [key: string]: any;
}

Members

get<T>(section: string): T | undefined;

Return a value from this configuration.

get<T>(section: string, defaultValue: T): T;

Return a value from this configuration.

has(section: string): boolean;

Check if this configuration has a certain value.

inspect<T>(section: string): ConfigurationInspect<T> | undefined;

Retrieve all information about a configuration setting. A configuration value often consists of a default value, a global or installation-wide value, a workspace-specific value

Note: The configuration name must denote a leaf in the configuration tree (editor.fontSize vs editor) otherwise no result is returned.

update(section: string, value: any, updateTarget?: ConfigurationTarget | boolean): Thenable<void>;

Update a configuration value. The updated configuration values are persisted to configuration file.

readonly [key: string]: any;

Readable dictionary that backs this configuration.

Kind
interface
Declaration
typings/index.d.ts:10132
types

BufferSyncItem

Interface exported by coc.nvim.

Source

Interface definition

export interface BufferSyncItem {
    dispose: () => void;
    onChange?(e: DidChangeTextDocumentParams): void;
    onTextChange?(): void;
    onVisible?(winid: number, region: Readonly<[
        number,
        number
    ]>): void;
}

Members

dispose: () => void;

Called on buffer unload.

onChange?(e: DidChangeTextDocumentParams): void;

Called on buffer content change.

onTextChange?(): void;

Called when NodeJS client receive lines change event, could be before or after TextChangedI and TextChangedP events, but always before TextDocumentContentChange event.

onVisible?(winid: number, region: Readonly<[ number, number ]>): void;

Called on WindowVisible event when exists. region contains, 1 based, end inclusive topline, botline

Kind
interface
Declaration
typings/index.d.ts:10187
types

BufferSync

Interface exported by coc.nvim.

Source

Interface definition

export interface BufferSync<T extends BufferSyncItem> {
    readonly items: Iterable<T>;
    getItem(uri: string): T | undefined;
    getItem(bufnr: number): T | undefined;
    dispose: () => void;
}

Members

readonly items: Iterable<T>;

Current items.

getItem(uri: string): T | undefined;

Get created item by uri

getItem(bufnr: number): T | undefined;

Get created item by bufnr

dispose: () => void;

Dispose all items.

Kind
interface
Declaration
typings/index.d.ts:10209
types

FuzzyMatchResult

Interface exported by coc.nvim.

Source

Interface definition

export interface FuzzyMatchResult {
    score: number;
    positions: Uint32Array;
}

Members

score: number;

Score of the match, higher is better.

positions: Uint32Array;

Matched character positions.

Kind
interface
Declaration
typings/index.d.ts:10228
types

FuzzyMatchHighlights

Interface exported by coc.nvim.

Source

Interface definition

export interface FuzzyMatchHighlights {
    score: number;
    highlights: AnsiHighlight[];
}

Members

score: number;

Score of the match, higher is better.

highlights: AnsiHighlight[];

Highlights of the match.

Kind
interface
Declaration
typings/index.d.ts:10239
types

FuzzyScore

An array representing a fuzzy match.

  1. the score
  2. the offset at which matching started
  3. <match_pos_N>
  4. <match_pos_1>
  5. <match_pos_0> etc
Source

Type definition

export type FuzzyScore = [
    score: number,
    wordStart: number,
    ...matches: number[]
];
Kind
type alias
Declaration
typings/index.d.ts:10259
types

FuzzyScoreOptions

Interface exported by coc.nvim.

Source

Interface definition

export interface FuzzyScoreOptions {
    readonly boostFullMatch: boolean;
    readonly firstMatchCanBeWeak: boolean;
}

Members

readonly boostFullMatch: boolean;

Boost the score of full matches.

readonly firstMatchCanBeWeak: boolean;

Allows first match to be a weak match

Kind
interface
Declaration
typings/index.d.ts:10261
types

FuzzyKind

Match kinds could be:

  • 'aggressive' with fixed match for permutations.
  • 'any' fast match with first 13 characters only.
  • 'normal' nothing special.
Source

Type definition

export type FuzzyKind = 'normal' | 'aggressive' | 'any';
Kind
type alias
Declaration
typings/index.d.ts:10279
types

ScoreFunction

Type alias exported by coc.nvim.

Source

Type definition

export type ScoreFunction = (word: string, wordPos?: number) => FuzzyScore | undefined;
Kind
type alias
Declaration
typings/index.d.ts:10281
types

FuzzyMatch

Interface exported by coc.nvim.

Source

Interface definition

export interface FuzzyMatch {
    matchScoreSpans(text: string, score: FuzzyScore): Iterable<[
        number,
        number
    ]>;
    createScoreFunction(pattern: string, patternPos: number, options?: FuzzyScoreOptions, kind?: FuzzyKind): ScoreFunction;
    setPattern(pattern: string, matchSeq?: boolean): void;
    match(text: string): FuzzyMatchResult | undefined;
    matchSpans(text: string, positions: ArrayLike<number>, max?: number): Iterable<[
        number,
        number
    ]>;
    matchHighlights(text: string, hlGroup: string): FuzzyMatchHighlights | undefined;
}

Members

matchScoreSpans(text: string, score: FuzzyScore): Iterable<[ number, number ]>;

Create 0 index byte spans from matched text and FuzzyScore. Mostly used for create highlight items.

createScoreFunction(pattern: string, patternPos: number, options?: FuzzyScoreOptions, kind?: FuzzyKind): ScoreFunction;

Create a score function

setPattern(pattern: string, matchSeq?: boolean): void;

Initialize match by set the match pattern and matchSeq.

match(text: string): FuzzyMatchResult | undefined;

Get the match result of text including score and character index positions, return undefined when no match found.

matchSpans(text: string, positions: ArrayLike<number>, max?: number): Iterable<[ number, number ]>;

Match character positions to column spans. Better than matchHighlights method by reduce iteration.

matchHighlights(text: string, hlGroup: string): FuzzyMatchHighlights | undefined;

Get the match highlights result, including score and highlight items. Return undefined when no match found.

Kind
interface
Declaration
typings/index.d.ts:10283
types

TextDocumentMatch

Interface exported by coc.nvim.

Source

Interface definition

export interface TextDocumentMatch {
    readonly uri: string;
    readonly languageId: string;
}

Members

readonly uri: string;

Uri of the document.

readonly languageId: string;

Language id of the document.

Kind
interface
Declaration
typings/index.d.ts:10343
types

PatternType

Type of pattern used by workspace folder.

Source

Enum definition

export enum PatternType {
    Buffer,
    LanguageServer,
    Global
}

Members

LanguageServer
Global
Kind
enum
Declaration
typings/index.d.ts:10357
types

TerminalExitStatus

Represents how a terminal exited.

Source

Interface definition

export interface TerminalExitStatus {
    readonly code: number | undefined;
}

Members

readonly code: number | undefined;

The exit code that a terminal exited with, it can have the following values:

  • Zero: the terminal process or custom execution succeeded.
  • Non-zero: the terminal process or custom execution failed.
  • undefined: the user forcibly closed the terminal or a custom execution exited without providing an exit code.
Kind
interface
Declaration
typings/index.d.ts:10855
types

TerminalOptions

Interface exported by coc.nvim.

Source

Interface definition

export interface TerminalOptions {
    name?: string;
    shellPath?: string;
    shellArgs?: string[];
    cwd?: string;
    env?: {
        [key: string]: string | null;
    };
    strictEnv?: boolean;
}

Members

name?: string;

A human-readable string which will be used to represent the terminal in the UI.

shellPath?: string;

A path to a custom shell executable to be used in the terminal.

shellArgs?: string[];

Args for the custom shell executable, this does not work on Windows (see #8429)

cwd?: string;

A path or URI for the current working directory to be used for the terminal.

env?: { [key: string]: string | null; };

Object with environment variables that will be added to the VS Code process.

strictEnv?: boolean;

Whether the terminal process environment should be exactly as provided in TerminalOptions.env. When this is false (default), the environment will be based on the window's environment and also apply configured platform settings like terminal.integrated.windows.env on top. When this is true, the complete environment must be provided as nothing will be inherited from the process or any configuration. Neovim only.

Kind
interface
Declaration
typings/index.d.ts:10866
types

Terminal

An individual terminal instance within the integrated terminal.

Source

Interface definition

export interface Terminal {
    readonly bufnr: number;
    readonly name: string;
    readonly processId: Promise<number>;
    readonly exitStatus: TerminalExitStatus | undefined;
    sendText(text: string, addNewLine?: boolean): void;
    show(preserveFocus?: boolean): Promise<boolean>;
    hide(): void;
    dispose(): void;
}

Members

readonly bufnr: number;

The bufnr of terminal buffer.

readonly name: string;

The name of the terminal.

readonly processId: Promise<number>;

The process ID of the shell process.

readonly exitStatus: TerminalExitStatus | undefined;

The exit status of the terminal, this will be undefined while the terminal is active.

Example: Show a notification with the exit code when the terminal exists with a non-zero exit code.

window.onDidCloseTerminal(t => {
  if (t.exitStatus && t.exitStatus.code) {
  	vscode.window.showInformationMessage(`Exit code: ${t.exitStatus.code}`);
  }
});
sendText(text: string, addNewLine?: boolean): void;

Send text to the terminal. The text is written to the stdin of the underlying pty process (shell) of the terminal.

show(preserveFocus?: boolean): Promise<boolean>;

Show the terminal panel and reveal this terminal in the UI, return false when failed.

hide(): void;

Hide the terminal panel if this terminal is currently showing.

dispose(): void;

Dispose and free associated resources.

Kind
interface
Declaration
typings/index.d.ts:10906
types

StatusItemOption

Option for create status item.

Source

Interface definition

export interface StatusItemOption {
    progress?: boolean;
}

Members

progress?: boolean;

Show the item as a progress indicator.

Kind
interface
Declaration
typings/index.d.ts:10970
types

StatusBarItem

Status item that included in g:coc_status

Source

Interface definition

export interface StatusBarItem {
    readonly priority: number;
    isProgress: boolean;
    text: string;
    show(): void;
    hide(): void;
    dispose(): void;
}

Members

readonly priority: number;

The priority of this item. Higher value means the item should be shown more to the left.

isProgress: boolean;

Whether the item is a progress indicator.

text: string;

The text to show for the entry. You can embed icons in the text by leveraging the syntax:

My text $(icon-name) contains icons like $(icon-name) this one.

Where the icon-name is taken from the octicon icon set, e.g. light-bulb, thumbsup, zap etc.

show(): void;

Shows the entry in the status bar.

hide(): void;

Hide the entry in the status bar.

dispose(): void;

Dispose and free associated resources. Call hide.

Kind
interface
Declaration
typings/index.d.ts:10980
types

ProgressOptions

Value-object describing where and how progress should show.

Source

Interface definition

export interface ProgressOptions {
    title?: string;
    cancellable?: boolean;
}

Members

title?: string;

A human-readable string which will be used to describe the operation.

cancellable?: boolean;

Controls if a cancel button should show to allow the user to cancel the long running operation.

Kind
interface
Declaration
typings/index.d.ts:11022
types

Progress

Defines a generalized way of reporting progress updates.

Source

Interface definition

export interface Progress<T> {
    report(value: T): void;
}

Members

report(value: T): void;

Report a progress update.

Kind
interface
Declaration
typings/index.d.ts:11040
types

MessageItem

Represents an action that is shown with an information, warning, or error message.

Source

Interface definition

export interface MessageItem {
    title: string;
    isCloseAffordance?: boolean;
}

Members

title: string;

A short title like 'Retry', 'Open Log' etc.

isCloseAffordance?: boolean;

A hint for modal dialogs that the item should be triggered when the user cancels the dialog (e.g. by pressing the ESC key).

Note: this option is ignored for non-modal messages. Note: not used by coc.nvim for now.

Kind
interface
Declaration
typings/index.d.ts:11059
types

DialogButton

Interface exported by coc.nvim.

Source

Interface definition

export interface DialogButton {
    index: number;
    text: string;
    disabled?: boolean;
}

Members

index: number;

Use by callback, should >= 0

text: string;

Text of the button.

disabled?: boolean;

Not shown when true

Kind
interface
Declaration
typings/index.d.ts:11077
types

DialogConfig

Interface exported by coc.nvim.

Source

Interface definition

export interface DialogConfig {
    content: string;
    title?: string;
    close?: boolean;
    highlight?: string;
    highlights?: ReadonlyArray<HighlightItem>;
    borderhighlight?: string;
    buttons?: DialogButton[];
    callback?: (index: number) => void;
}

Members

content: string;

Content shown in window.

title?: string;

Optional title text.

close?: boolean;

show close button, default to true when not specified.

highlight?: string;

highlight group for dialog window, default to "dialog.floatHighlight" or 'CocFlating'

highlights?: ReadonlyArray<HighlightItem>;

highlight items of content.

borderhighlight?: string;

highlight groups for border, default to "dialog.borderhighlight" or 'CocFlating'

buttons?: DialogButton[];

Buttons as bottom of dialog.

callback?: (index: number) => void;

index is -1 for window close without button click

Kind
interface
Declaration
typings/index.d.ts:11092
types

NotificationKind

Type alias exported by coc.nvim.

Source

Type definition

export type NotificationKind = 'error' | 'info' | 'warning' | 'progress';
Kind
type alias
Declaration
typings/index.d.ts:11127
types

NotificationConfig

Interface exported by coc.nvim.

Source

Interface definition

export interface NotificationConfig {
    kind?: NotificationKind;
    content?: string;
    title?: string;
    buttons?: DialogButton[];
    callback?: (index: number) => void;
}

Members

kind?: NotificationKind;

Kind of the notification.

content?: string;

Content of the notification.

title?: string;

Optional title text.

buttons?: DialogButton[];

Buttons as bottom of dialog.

callback?: (index: number) => void;

index is -1 for window close without button click

Kind
interface
Declaration
typings/index.d.ts:11129
types

QuickPickOptions

Options to configure the behavior of the quick pick UI.

Source

Interface definition

export interface QuickPickOptions {
    title?: string;
    placeHolder?: string;
    matchOnDescription?: boolean;
    canPickMany?: boolean;
    placeholder?: string;
}

Members

title?: string;

An optional string that represents the title of the quick pick.

placeHolder?: string;

Placeholder text that shown when input value is empty.

matchOnDescription?: boolean;

An optional flag to include the description when filtering the picks.

canPickMany?: boolean;

An optional flag to make the picker accept multiple selections, if true the result is an array of picks.

placeholder?: string;
Kind
interface
Declaration
typings/index.d.ts:11155
types

QuickPickItem

Represents an item that can be selected from a list of items.

Source

Interface definition

export interface QuickPickItem {
    label: string;
    description?: string;
    picked?: boolean;
}

Members

label: string;

A human-readable string which is rendered prominent

description?: string;

A human-readable string which is rendered less prominent in the same line

picked?: boolean;

Optional flag indicating if this item is picked initially.

Kind
interface
Declaration
typings/index.d.ts:11182
types

QuickPickConfig

Interface exported by coc.nvim.

Source

Interface definition

export interface QuickPickConfig<T extends QuickPickItem> {
    title?: string;
    placeholder?: string;
    items: readonly T[];
    value?: string;
    canSelectMany?: boolean;
    matchOnDescription: boolean;
}

Members

title?: string;

An optional title.

placeholder?: string;

Placeholder text that shown when input value is empty.

items: readonly T[];

Items to pick from.

value?: string;

Initial value of the filter text.

canSelectMany?: boolean;

If multiple items can be selected at the same time. Defaults to false.

matchOnDescription: boolean;

If the filter text should also be matched against the description of the items. Defaults to false.

Kind
interface
Declaration
typings/index.d.ts:11197
types

QuickPick

Interface exported by coc.nvim.

Source

Interface definition

export interface QuickPick<T extends QuickPickItem> {
    value: string;
    title: string | undefined;
    placeholder: string | undefined;
    loading: boolean;
    items: readonly T[];
    activeItems: readonly T[];
    matchOnDescription: boolean;
    canSelectMany: boolean;
    maxHeight: number;
    width: number | undefined;
    readonly inputBox: InputBox | undefined;
    readonly currIndex: number;
    readonly buffer: number;
    readonly winid: number | undefined;
    readonly onDidFinish: Event<T[] | null>;
    readonly onDidChangeValue: Event<string>;
    readonly onDidChangeSelection: Event<readonly T[]>;
    show(): Promise<void>;
}

Members

value: string;

Set or get current input value.

title: string | undefined;

An optional title.

placeholder: string | undefined;

An optional placeholder text.

loading: boolean;

If the UI should show a progress indicator. Defaults to false.

Change this to true, e.g., while loading more data or validating user input.

items: readonly T[];

Items to pick from. This can be read and updated by the extension.

activeItems: readonly T[];

Active items. This can be read and updated by the extension.

matchOnDescription: boolean;

If the filter text should also be matched against the description of the items. Defaults to false.

canSelectMany: boolean;

If multiple items can be selected at the same time. Defaults to false.

maxHeight: number;

Max height of list, ``

width: number | undefined;

Width of window, limited by dialog.maxWidth configuration and vim's 'columns'. Undefined by default, which means the width is dynamically calculated.

readonly inputBox: InputBox | undefined;

Represents the input prompt box field of the quickpick element

readonly currIndex: number;

The current selection index, can be used to act on an item with onDidFinish, even if the item is not selected. The index corresponds to the .items or .activeItems arrays, and can be used to index into them

readonly buffer: number;

The buffer for the popup element of the quick pick containing the .items to be selected

readonly winid: number | undefined;

The window for the popup element of the quick pick containing the .items to be selected

readonly onDidFinish: Event<T[] | null>;

An event signaling when QuickPick closed, fired with selected items or null when canceled.

readonly onDidChangeValue: Event<string>;

An event signaling when the value of the filter text has changed.

readonly onDidChangeSelection: Event<readonly T[]>;

An event signaling when the selected items have changed.

show(): Promise<void>;

Makes the input UI visible in its current configuration.

Kind
interface
Declaration
typings/index.d.ts:11224
types

ScreenPosition

Interface exported by coc.nvim.

Source

Interface definition

export interface ScreenPosition {
    row: number;
    col: number;
}

Members

row: number;

Screen row, 1 based.

col: number;

Screen column, 1 based.

Kind
interface
Declaration
typings/index.d.ts:11305
types

MsgTypes

Type alias exported by coc.nvim.

Source

Type definition

export type MsgTypes = 'error' | 'warning' | 'more';
Kind
type alias
Declaration
typings/index.d.ts:11316
types

OpenTerminalOption

Interface exported by coc.nvim.

Source

Interface definition

export interface OpenTerminalOption {
    cwd?: string;
    autoclose?: boolean;
    keepfocus?: boolean;
    position?: 'bottom' | 'right';
}

Members

cwd?: string;

Cwd of terminal, default to result of |getcwd()|

autoclose?: boolean;

Close terminal on job finish, default to true.

keepfocus?: boolean;

Keep focus current window, default to false.

position?: 'bottom' | 'right';

Position of terminal window, default to 'right'.

Kind
interface
Declaration
typings/index.d.ts:11318
types

OutputChannel

An output channel is a container for readonly textual information.

To get an instance of an OutputChannel use createOutputChannel.

Source

Interface definition

export interface OutputChannel {
    readonly name: string;
    readonly content: string;
    append(value: string): void;
    appendLine(value: string): void;
    clear(keep?: number): void;
    show(preserveFocus?: boolean): void;
    hide(): void;
    dispose(): void;
}

Members

readonly name: string;

The human-readable name of this output channel.

readonly content: string;

Current content of the channel.

append(value: string): void;

Append the given value to the channel.

appendLine(value: string): void;

Append the given value and a line feed character to the channel.

clear(keep?: number): void;

Removes output from the channel. Latest keep lines will be remained.

show(preserveFocus?: boolean): void;

Reveal this channel in the UI.

hide(): void;

Hide this channel from the UI.

dispose(): void;

Dispose and free associated resources.

Kind
interface
Declaration
typings/index.d.ts:11343
types

TerminalResult

Interface exported by coc.nvim.

Source

Interface definition

export interface TerminalResult {
    bufnr: number;
    success: boolean;
    content?: string;
}

Members

bufnr: number;

Buffer number of the terminal.

success: boolean;

Whether the command finished successfully.

content?: string;

Output content of the terminal.

Kind
interface
Declaration
typings/index.d.ts:11392
types

Dialog

Interface exported by coc.nvim.

Source

Interface definition

export interface Dialog {
    bufnr: number;
    winid: Promise<number | null>;
    dispose: () => void;
}

Members

bufnr: number;

Buffer number of dialog.

winid: Promise<number | null>;

Window id of dialog.

dispose: () => void;

Dispose the dialog.

Kind
interface
Declaration
typings/index.d.ts:11407
types

HighlightItemDef

Type alias exported by coc.nvim.

Source

Type definition

export type HighlightItemDef = [
    string,
    number,
    number,
    number,
    number?,
    number?,
    number?
];
Kind
type alias
Declaration
typings/index.d.ts:11422
types

HighlightDiff

Interface exported by coc.nvim.

Source

Interface definition

export interface HighlightDiff {
    remove: number[];
    removeMarkers: number[];
    add: HighlightItemDef[];
}

Members

remove: number[];

Namespaces to remove.

removeMarkers: number[];

Marker namespaces to remove.

add: HighlightItemDef[];

Highlights to add.

Kind
interface
Declaration
typings/index.d.ts:11424
types

InputOptions

Interface exported by coc.nvim.

Source

Interface definition

export interface InputOptions {
    placeholder?: string;
    position?: 'cursor' | 'center';
    marginTop?: number;
    borderhighlight?: string;
    list?: boolean;
}

Members

placeholder?: string;

Placeholder text that shown when input value is empty.

position?: 'cursor' | 'center';

Position to show input, default to 'cursor'

marginTop?: number;

Margin top editor when position is 'center'

borderhighlight?: string;

Border highlight of float window/popup, configuration dialog.borderhighlight used as default.

list?: boolean;

Create key-mappings for quickpick list.

Kind
interface
Declaration
typings/index.d.ts:11469
types

InputPreference

Interface exported by coc.nvim.

Source

Interface definition

export interface InputPreference extends InputOptions {
    border?: [
        0 | 1,
        0 | 1,
        0 | 1,
        0 | 1
    ];
    rounded?: boolean;
    minWidth?: number;
    maxWidth?: number;
}

Members

border?: [ 0 | 1, 0 | 1, 0 | 1, 0 | 1 ];

Top, right, bottom, left border existence, default to [1,1,1,1]

rounded?: boolean;

Rounded border, default to true, configuration dialog.rounded used as default.

minWidth?: number;

Minimal window width, g:coc_prompt_win_width or 32 used as default.

maxWidth?: number;

Maximum window width, configuration dialog.maxWidth used as default.

Kind
interface
Declaration
typings/index.d.ts:11492
types

InputDimension

Interface exported by coc.nvim.

Source

Interface definition

export interface InputDimension {
    readonly width: number;
    readonly height: number;
    readonly row: number;
    readonly col: number;
}

Members

readonly width: number;

Width of the input window.

readonly height: number;

Height of the input window.

readonly row: number;

0 based screen row

readonly col: number;

O based screen col

Kind
interface
Declaration
typings/index.d.ts:11511
types

InputBox

Interface exported by coc.nvim.

Source

Interface definition

export interface InputBox {
    value: string;
    title: string;
    loading: boolean;
    borderhighlight: string;
    readonly dimension: InputDimension;
    readonly bufnr: number;
    readonly onDidChange: Event<string>;
    readonly onDidFinish: Event<string | null>;
}

Members

value: string;

Current input text, could be changed.

title: string;

Change or get title of input box.

loading: boolean;

Change or get loading state of input box.

borderhighlight: string;

Change or get borderhighlight of input box.

readonly dimension: InputDimension;

Dimension of float window/popup

readonly bufnr: number;

Buffer number of float window/popup

readonly onDidChange: Event<string>;

An event signaling when the value has changed.

readonly onDidFinish: Event<string | null>;

An event signaling input finished, emit input value or null when canceled.

Kind
interface
Declaration
typings/index.d.ts:11530
types

FloatWinConfig

FloatWinConfig.

Source

Interface definition

export interface FloatWinConfig {
    border?: boolean | [
        number,
        number,
        number,
        number
    ];
    rounded?: boolean;
    highlight?: string;
    title?: string;
    borderhighlight?: string;
    close?: boolean;
    maxHeight?: number;
    maxWidth?: number;
    winblend?: number;
    focusable?: boolean;
    shadow?: boolean;
    preferTop?: boolean;
    autoHide?: boolean;
    offsetX?: number;
    cursorline?: boolean;
    modes?: string[];
    excludeImages?: boolean;
    position?: "fixed" | "auto";
    top?: number;
    bottom?: number;
    left?: number;
    right?: number;
}

Members

border?: boolean | [ number, number, number, number ];

Show border of the window.

rounded?: boolean;

Use rounded border.

highlight?: string;

Highlight group of the window.

title?: string;

Title of the window.

borderhighlight?: string;

Highlight group of the border.

close?: boolean;

Show close button.

maxHeight?: number;

Max height of the window.

maxWidth?: number;

Max width of the window.

winblend?: number;

Blend of the window, works on neovim.

focusable?: boolean;

Whether the window is focusable.

shadow?: boolean;

Show shadow, works on neovim.

preferTop?: boolean;

Prefer show the window above the cursor.

autoHide?: boolean;

Hide the window when cursor moved.

offsetX?: number;

Offset x of the window from the cursor.

cursorline?: boolean;

Show cursorline in the window.

modes?: string[];

Modes the window is shown in.

excludeImages?: boolean;

Exclude image links in markdown content.

position?: "fixed" | "auto";

Position of the window.

top?: number;

Top position of the window.

bottom?: number;

Bottom position of the window.

left?: number;

Left position of the window.

right?: number;

Right position of the window.

Kind
interface
Declaration
typings/index.d.ts:11568
types

FloatFactory

Class exported by coc.nvim.

Source

Class definition

export class FloatFactory {
    constructor(nvim: Neovim);
    show: (docs: Documentation[], options?: FloatWinConfig) => Promise<void>;
    close: () => void;
    activated: () => Promise<boolean>;
    dispose: () => void;
}

Members

constructor(nvim: Neovim);
show: (docs: Documentation[], options?: FloatWinConfig) => Promise<void>;

Show documentations in float window/popup. Window and buffer are reused when possible.

close: () => void;

Close the float window created by this float factory.

activated: () => Promise<boolean>;

Check if float window is shown.

dispose: () => void;

Unbind events

Kind
class
Declaration
typings/index.d.ts:11659
types

Logger

Extension-scoped logger with trace, debug, info, warning, error, fatal, and mark methods.

Source

Interface definition

export interface Logger {
    readonly category: string;
    log(...args: any[]): void;
    trace(message: any, ...args: any[]): void;
    debug(message: any, ...args: any[]): void;
    info(message: any, ...args: any[]): void;
    warn(message: any, ...args: any[]): void;
    error(message: any, ...args: any[]): void;
    fatal(message: any, ...args: any[]): void;
    mark(message: any, ...args: any[]): void;
}

Members

readonly category: string;

Category of the logger.

log(...args: any[]): void;

Log a message.

trace(message: any, ...args: any[]): void;

Log a trace message.

debug(message: any, ...args: any[]): void;

Log a debug message.

info(message: any, ...args: any[]): void;

Log an info message.

warn(message: any, ...args: any[]): void;

Log a warning message.

error(message: any, ...args: any[]): void;

Log an error message.

fatal(message: any, ...args: any[]): void;

Log a fatal message.

mark(message: any, ...args: any[]): void;

Log a mark message.

Example

import { ExtensionContext } from 'coc.nvim'

export function activate(context: ExtensionContext): void {
  const { logger } = context
  logger.info('Extension activated')

  try {
    // Extension work
  } catch (error) {
    logger.error('Extension failed:', error)
  }
}
Kind
interface
Declaration
typings/index.d.ts:12122
types

Memento

A memento represents a storage utility. It can store and retrieve values.

Source

Interface definition

export interface Memento {
    get<T>(key: string): T | undefined;
    get<T>(key: string, defaultValue: T): T;
    update(key: string, value: any): Promise<void>;
}

Members

get<T>(key: string): T | undefined;

Return a value.

get<T>(key: string, defaultValue: T): T;

Return a value.

update(key: string, value: any): Promise<void>;

Store a value. The value must be JSON-stringifyable.

Kind
interface
Declaration
typings/index.d.ts:12165
types

ExtensionState

Type alias exported by coc.nvim.

Source

Type definition

export type ExtensionState = 'disabled' | 'loaded' | 'activated' | 'unknown';
Kind
type alias
Declaration
typings/index.d.ts:12194
types

ExtensionType

Enum exported by coc.nvim.

Source

Enum definition

export enum ExtensionType {
    Global,
    Local,
    SingleFile,
    Internal
}

Members

Global
Local
SingleFile
Internal
Kind
enum
Declaration
typings/index.d.ts:12196
types

ExtensionJson

Interface exported by coc.nvim.

Source

Interface definition

export interface ExtensionJson {
    name: string;
    main?: string;
    engines: {
        [key: string]: string;
    };
    version?: string;
    [key: string]: any;
}

Members

name: string;

Name of the extension.

main?: string;

Entry file of the extension.

engines: { [key: string]: string; };

Engines required by the extension.

version?: string;

Version of the extension.

[key: string]: any;
Kind
interface
Declaration
typings/index.d.ts:12203
types

ExtensionInfo

Interface exported by coc.nvim.

Source

Interface definition

export interface ExtensionInfo {
    id: string;
    version: string;
    description: string;
    root: string;
    exotic: boolean;
    uri?: string;
    state: ExtensionState;
    isLocal: boolean;
    packageJSON: Readonly<ExtensionJson>;
}

Members

id: string;

Full identifier of the extension.

version: string;

Version of the extension.

description: string;

Description of the extension.

root: string;

Root directory of the extension.

exotic: boolean;

Whether the extension is exotic.

uri?: string;

Uri of the extension.

state: ExtensionState;

State of the extension.

isLocal: boolean;

Whether the extension is local.

packageJSON: Readonly<ExtensionJson>;

Parsed package.json of the extension.

Kind
interface
Declaration
typings/index.d.ts:12225
types

Extension

Represents an extension.

To get an instance of an Extension use getExtension.

Source

Interface definition

export interface Extension<T> {
    readonly id: string;
    readonly extensionPath: string;
    readonly extensionUri: Uri;
    readonly isActive: boolean;
    readonly packageJSON: any;
    readonly exports: T;
    activate(): Promise<T>;
}

Members

readonly id: string;

The canonical extension identifier in the form of: publisher.name.

readonly extensionPath: string;

The absolute file path of the directory containing this extension.

readonly extensionUri: Uri;

The uri of the directory containing the extension.

readonly isActive: boolean;

true if the extension has been activated.

readonly packageJSON: any;

The parsed contents of the extension's package.json.

readonly exports: T;

The public API exported by this extension (return value of activate). It is an invalid action to access this field before this extension has been activated.

activate(): Promise<T>;

Activates this extension and returns its public API.

Kind
interface
Declaration
typings/index.d.ts:12269
types

ExtensionContext

Utilities and lifecycle state provided to an extension activation function, including subscriptions, storage paths, state, and logging.

Source

Interface definition

export interface ExtensionContext {
    subscriptions: Disposable[];
    extensionPath: string;
    asAbsolutePath(relativePath: string): string;
    storagePath: string;
    workspaceState: Memento;
    globalState: Memento;
    logger: Logger;
}

Members

subscriptions: Disposable[];

An array to which disposables can be added. When this extension is deactivated the disposables will be disposed.

extensionPath: string;

The absolute file path of the directory containing the extension.

asAbsolutePath(relativePath: string): string;

Get the absolute path of a resource contained in the extension.

storagePath: string;

The absolute directory path for extension to download persist data. The directory might not exist.

workspaceState: Memento;

A memento object that stores state in the context of the currently opened workspace.

globalState: Memento;

A memento object that stores state independent of the current opened workspace.

logger: Logger;

Logger of the extension.

Example

import { commands, ExtensionContext } from 'coc.nvim'

export function activate(context: ExtensionContext): void {
  const disposable = commands.registerCommand('demo.showPath', () => {
    context.logger.info('Extension path:', context.extensionPath)
  })

  context.subscriptions.push(disposable)
  const runs = context.globalState.get<number>('runs', 0)
  void context.globalState.update('runs', runs + 1)
}
Kind
interface
Declaration
typings/index.d.ts:12317
types

PropertyScheme

Interface exported by coc.nvim.

Source

Interface definition

export interface PropertyScheme {
    type: string;
    default: any;
    description: string;
    enum?: string[];
    items?: any;
    [key: string]: any;
}

Members

type: string;

Type of the property.

default: any;

Default value of the property.

description: string;

Description of the property.

enum?: string[];

Enum values of the property.

items?: any;

Items of the property when it is an array.

[key: string]: any;
Kind
interface
Declaration
typings/index.d.ts:12362
types

LocationWithTarget

Interface exported by coc.nvim.

Source

Interface definition

export interface LocationWithTarget extends Location {
    targetRange?: Range;
}

Members

targetRange?: Range;

The full target range of this link. If the target for example is a symbol then target range is the range enclosing this symbol not including leading/trailing whitespace but everything else like comments. This information is typically used to highlight the range in the editor.

Kind
interface
Declaration
typings/index.d.ts:12433
types

LocationWithLine

Interface exported by coc.nvim.

Source

Interface definition

export interface LocationWithLine {
    uri: string;
    line: string;
    text?: string;
}

Members

uri: string;

Uri of the location.

line: string;

Match text of line.

text?: string;

Highlight text in line.

Kind
interface
Declaration
typings/index.d.ts:12441
types

AnsiHighlight

Interface exported by coc.nvim.

Source

Interface definition

export interface AnsiHighlight {
    span: [
        number,
        number
    ];
    hlGroup: string;
}

Members

span: [ number, number ];

Byte indexes, 0 based.

hlGroup: string;

Highlight group of the span.

Kind
interface
Declaration
typings/index.d.ts:12456
types

ListItem

Interface exported by coc.nvim.

Source

Interface definition

export interface ListItem {
    label: string;
    preselect?: boolean;
    filterText?: string;
    sortText?: string;
    location?: LocationWithTarget | LocationWithLine | string;
    data?: any;
    ansiHighlights?: AnsiHighlight[];
    resolved?: boolean;
    converted?: boolean;
}

Members

label: string;

Label of the item.

preselect?: boolean;

Select the item by default.

filterText?: string;

Text used for filtering.

sortText?: string;

A string that should be used when comparing this item with other items, only used for fuzzy filter.

location?: LocationWithTarget | LocationWithLine | string;

Location of the item.

data?: any;

Custom data of the item.

ansiHighlights?: AnsiHighlight[];

Ansi highlights of the label.

resolved?: boolean;

Whether the item is resolved.

converted?: boolean;

Whether the location of the item has been converted.

Kind
interface
Declaration
typings/index.d.ts:12467
types

ListMode

Type alias exported by coc.nvim.

Source

Type definition

export type ListMode = 'normal' | 'insert';
Kind
type alias
Declaration
typings/index.d.ts:12507
types

ListMatcher

Type alias exported by coc.nvim.

Source

Type definition

export type ListMatcher = 'strict' | 'fuzzy' | 'regex';
Kind
type alias
Declaration
typings/index.d.ts:12509
types

ListOptions

Interface exported by coc.nvim.

Source

Interface definition

export interface ListOptions {
    position: string;
    reverse: boolean;
    input: string;
    ignorecase: boolean;
    interactive: boolean;
    sort: boolean;
    mode: ListMode;
    matcher: ListMatcher;
    autoPreview: boolean;
    numberSelect: boolean;
    noQuit: boolean;
    first: boolean;
}

Members

position: string;

Position of the list window.

reverse: boolean;

Reverse the list when true.

input: string;

Initial input of the list.

ignorecase: boolean;

Ignore case when filtering.

interactive: boolean;

Interactive mode of the list.

sort: boolean;

Sort the items when true.

mode: ListMode;

Mode of the list.

matcher: ListMatcher;

Matcher of the list.

autoPreview: boolean;

Auto preview of the list.

numberSelect: boolean;

Number select of the list.

noQuit: boolean;

Do not quit after action.

first: boolean;

Select the first item by default.

Kind
interface
Declaration
typings/index.d.ts:12511
types

ListContext

Interface exported by coc.nvim.

Source

Interface definition

export interface ListContext {
    input: string;
    cwd: string;
    options: ListOptions;
    args: string[];
    window: Window;
    buffer: Buffer;
    listWindow: Window | null;
}

Members

input: string;

Input on list activated.

cwd: string;

Current work directory on activated.

options: ListOptions;

Options of list.

args: string[];

Arguments passed to list.

window: Window;

Original window on list invoke.

buffer: Buffer;

Original buffer on list invoke.

listWindow: Window | null;

Window of the list, null when not created.

Kind
interface
Declaration
typings/index.d.ts:12562
types

ListAction

Interface exported by coc.nvim.

Source

Interface definition

export interface ListAction {
    name: string;
    persist?: boolean;
    reload?: boolean;
    parallel?: boolean;
    multiple?: boolean;
    tabPersist?: boolean;
    execute: (item: ListItem | ListItem[], context: ListContext) => ProviderResult<void>;
}

Members

name: string;

Action name

persist?: boolean;

Should persist list window on invoke.

reload?: boolean;

Should reload list after invoke.

parallel?: boolean;

Invoke all selected items in parallel.

multiple?: boolean;

Support handle multiple items at once.

tabPersist?: boolean;

Tab positioned list should be persisted (no window switch) on action invoke.

execute: (item: ListItem | ListItem[], context: ListContext) => ProviderResult<void>;

Item is array of selected items when multiple is true.

Kind
interface
Declaration
typings/index.d.ts:12593
types

ListTask

Interface exported by coc.nvim.

Source

Interface definition

export interface ListTask {
    on(event: 'data', callback: (item: ListItem) => void): void;
    on(event: 'end', callback: () => void): void;
    on(event: 'error', callback: (msg: string | Error) => void): void;
    dispose(): void;
}

Members

on(event: 'data', callback: (item: ListItem) => void): void;

Listen to data events.

on(event: 'end', callback: () => void): void;

Listen to end events.

on(event: 'error', callback: (msg: string | Error) => void): void;

Listen to error events.

dispose(): void;

Dispose the task.

Kind
interface
Declaration
typings/index.d.ts:12635
types

ListArgument

Interface exported by coc.nvim.

Source

Interface definition

export interface ListArgument {
    key?: string;
    hasValue?: boolean;
    name: string;
    description: string;
}

Members

key?: string;

Key of the argument.

hasValue?: boolean;

Whether the argument has a value.

name: string;

Name of the argument.

description: string;

Description of the argument.

Kind
interface
Declaration
typings/index.d.ts:12654
types

IList

Interface exported by coc.nvim.

Source

Interface definition

export interface IList {
    name: string;
    defaultAction: string;
    actions: ListAction[];
    loadItems(context: ListContext, token: CancellationToken): Promise<ListItem[] | ListTask | null | undefined>;
    interactive?: boolean;
    description?: string;
    detail?: string;
    options?: ListArgument[];
    resolveItem?(item: ListItem): Promise<ListItem | null>;
    doHighlight?(): void;
    dispose?(): void;
}

Members

name: string;

Unique name of list.

defaultAction: string;

Default action name.

actions: ListAction[];

Action list.

loadItems(context: ListContext, token: CancellationToken): Promise<ListItem[] | ListTask | null | undefined>;

Load list items.

interactive?: boolean;

Should be true when interactive is supported.

description?: string;

Description of list.

detail?: string;

Detail description, shown in help.

options?: ListArgument[];

Options supported by list.

resolveItem?(item: ListItem): Promise<ListItem | null>;

Resolve list item.

doHighlight?(): void;

Highlight buffer by vim's syntax commands.

dispose?(): void;

Called on list unregistered.

Kind
interface
Declaration
typings/index.d.ts:12673
types

PreviewOptions

Interface exported by coc.nvim.

Source

Interface definition

export interface PreviewOptions {
    bufname?: string;
    lines: string[];
    filetype?: string;
    lnum?: number;
    range?: Range;
    sketch?: boolean;
}

Members

bufname?: string;

Buffer name of the preview window.

lines: string[];

Lines to preview.

filetype?: string;

Filetype of the preview window.

lnum?: number;

Line number to place the cursor on.

range?: Range;

Range to highlight in the preview window.

sketch?: boolean;
Kind
interface
Declaration
typings/index.d.ts:12720
types

SnippetSession

Interface exported by coc.nvim.

Source

Interface definition

export interface SnippetSession {
    isActive: boolean;
}

Members

isActive: boolean;

Whether the snippet session is active.

Kind
interface
Declaration
typings/index.d.ts:12760
types

UltiSnipsActions

Interface exported by coc.nvim.

Source

Interface definition

export interface UltiSnipsActions {
    preExpand?: string;
    postExpand?: string;
    postJump?: string;
}

Members

preExpand?: string;

Code executed before expansion.

postExpand?: string;

Code executed after expansion.

postJump?: string;

Code executed after jump.

Kind
interface
Declaration
typings/index.d.ts:12778
types

UltiSnippetOption

Interface exported by coc.nvim.

Source

Interface definition

export interface UltiSnippetOption {
    regex?: string;
    context?: string;
    noExpand?: boolean;
    trimTrailingWhitespace?: boolean;
    removeWhiteSpace?: boolean;
    actions: UltiSnipsActions;
}

Members

regex?: string;

Regex text for regex snippet.

context?: string;

Context code to execute.

noExpand?: boolean;

Do not expand tabs.

trimTrailingWhitespace?: boolean;

Trim all whitespaces from right side of snippet lines.

removeWhiteSpace?: boolean;

Remove whitespace immediately before the cursor at the end of a line before jumping to the next tabstop

actions: UltiSnipsActions;

UltiSnips action codes of the snippet.

Kind
interface
Declaration
typings/index.d.ts:12796
types

SnippetString

A snippet string is a template which allows to insert text and to control the editor cursor when insertion happens.

A snippet can define tab stops and placeholders with $1, $2 and ${3:foo}. $0 defines the final tab stop, it defaults to the end of the snippet. Variables are defined with $name and ${name:default value}. The full snippet syntax is documented here.

Source

Class definition

export class SnippetString {
    value: string;
    constructor(value?: string);
    appendText(string: string): SnippetString;
    appendTabstop(number?: number): SnippetString;
    appendPlaceholder(value: string | ((snippet: SnippetString) => any), number?: number): SnippetString;
    appendChoice(values: string[], number?: number): SnippetString;
    appendVariable(name: string, defaultValue?: string | ((snippet: SnippetString) => any)): SnippetString;
}

Members

value: string;

The snippet string.

constructor(value?: string);
appendText(string: string): SnippetString;

Builder-function that appends the given string to the value of this snippet string.

appendTabstop(number?: number): SnippetString;

Builder-function that appends a tabstop ($1, $2 etc) to the value of this snippet string.

appendPlaceholder(value: string | ((snippet: SnippetString) => any), number?: number): SnippetString;

Builder-function that appends a placeholder (${1:value}) to the value of this snippet string.

appendChoice(values: string[], number?: number): SnippetString;

Builder-function that appends a choice (${1|a,b,c|}) to the value of this snippet string.

appendVariable(name: string, defaultValue?: string | ((snippet: SnippetString) => any)): SnippetString;

Builder-function that appends a variable (${VAR}) to the value of this snippet string.

Kind
class
Declaration
typings/index.d.ts:12833
types

DiagnosticItem

Interface exported by coc.nvim.

Source

Interface definition

export interface DiagnosticItem {
    file: string;
    lnum: number;
    col: number;
    source: string;
    code: string | number;
    message: string;
    severity: string;
    level: number;
    location: Location;
}

Members

file: string;

Filepath of the diagnostic.

lnum: number;

Line number, 1 based.

col: number;

Column number, 1 based.

source: string;

Source of the diagnostic.

code: string | number;

Code of the diagnostic.

message: string;

Message of the diagnostic.

severity: string;

Severity of the diagnostic.

level: number;

Level of the diagnostic, 1 for error, 2 for warning, 3 for info, 4 for hint.

location: Location;

Location of the diagnostic.

Kind
interface
Declaration
typings/index.d.ts:12969
types

DiagnosticCollection

A diagnostics collection is a container that manages a set of diagnostics. Diagnostics are always scopes to a diagnostics collection and a resource.

To get an instance of a DiagnosticCollection use createDiagnosticCollection.

Source

Interface definition

export interface DiagnosticCollection {
    readonly name: string;
    set(uri: string, diagnostics: Diagnostic[] | null): void;
    set(entries: [
        string,
        Diagnostic[] | null
    ][] | string, diagnostics?: Diagnostic[]): void;
    delete(uri: string): void;
    clear(): void;
    forEach(callback: (uri: string, diagnostics: Diagnostic[], collection: DiagnosticCollection) => any, thisArg?: any): void;
    get(uri: string): Diagnostic[] | undefined;
    has(uri: string): boolean;
    dispose(): void;
}

Members

readonly name: string;

The name of this diagnostic collection, for instance typescript. Every diagnostic from this collection will be associated with this name. Also, the task framework uses this name when defining problem matchers.

set(uri: string, diagnostics: Diagnostic[] | null): void;

Assign diagnostics for given resource. Will replace existing diagnostics for that resource.

set(entries: [ string, Diagnostic[] | null ][] | string, diagnostics?: Diagnostic[]): void;

Replace all entries in this collection.

Diagnostics of multiple tuples of the same uri will be merged, e.g [[file1, [d1]], [file1, [d2]]] is equivalent to [[file1, [d1, d2]]]. If a diagnostics item is undefined as in [file1, undefined] all previous but not subsequent diagnostics are removed.

delete(uri: string): void;

Remove all diagnostics from this collection that belong to the provided uri. The same as #set(uri, undefined).

clear(): void;

Remove all diagnostics from this collection. The same as calling #set(undefined)

forEach(callback: (uri: string, diagnostics: Diagnostic[], collection: DiagnosticCollection) => any, thisArg?: any): void;

Iterate over each entry in this collection.

get(uri: string): Diagnostic[] | undefined;

Get the diagnostics for a given resource. Note that you cannot modify the diagnostics-array returned from this call.

has(uri: string): boolean;

Check if this collection contains diagnostics for a given resource.

dispose(): void;

Dispose and free associated resources. Calls clear.

Kind
interface
Declaration
typings/index.d.ts:13016
types

DiagnosticEventParams

Interface exported by coc.nvim.

Source

Interface definition

export interface DiagnosticEventParams {
    bufnr: number;
    uri: string;
    diagnostics: ReadonlyArray<Diagnostic>;
}

Members

bufnr: number;

Buffer number of the diagnostics.

uri: string;

Uri of the document.

diagnostics: ReadonlyArray<Diagnostic>;

Diagnostics of the document.

Kind
interface
Declaration
typings/index.d.ts:13092
types

ProgressToken

Type alias exported by coc.nvim.

Source

Type definition

export type ProgressToken = number | string;
Kind
type alias
Declaration
typings/index.d.ts:13143
types

WorkDoneProgressBegin

Interface exported by coc.nvim.

Source

Interface definition

export interface WorkDoneProgressBegin {
    kind: 'begin';
    title: string;
    cancellable?: boolean;
    message?: string;
    percentage?: number;
}

Members

kind: 'begin';

Progress kind, always begin.

title: string;

Mandatory title of the progress operation. Used to briefly inform about the kind of operation being performed.

Examples: "Indexing" or "Linking dependencies".

cancellable?: boolean;

Controls if a cancel button should show to allow the user to cancel the long running operation. Clients that don't support cancellation are allowed to ignore the setting.

message?: string;

Optional, more detailed associated progress message. Contains complementary information to the title.

Examples: "3/25 files", "project/src/module2", "node_modules/some_dep". If unset, the previous progress message (if any) is still valid.

percentage?: number;

Optional progress percentage to display (value 100 is considered 100%). If not provided infinite progress is assumed and clients are allowed to ignore the percentage value in subsequent in report notifications.

The value should be steadily rising. Clients are free to ignore values that are not following this rule.

Kind
interface
Declaration
typings/index.d.ts:13145
types

WorkDoneProgressReport

Interface exported by coc.nvim.

Source

Interface definition

export interface WorkDoneProgressReport {
    kind: 'report';
    cancellable?: boolean;
    message?: string;
    percentage?: number;
}

Members

kind: 'report';

Progress kind, always report.

cancellable?: boolean;

Controls enablement state of a cancel button. This property is only valid if a cancel button got requested in the WorkDoneProgressStart payload.

Clients that don't support cancellation or don't support control the button's enablement state are allowed to ignore the setting.

message?: string;

Optional, more detailed associated progress message. Contains complementary information to the title.

Examples: "3/25 files", "project/src/module2", "node_modules/some_dep". If unset, the previous progress message (if any) is still valid.

percentage?: number;

Optional progress percentage to display (value 100 is considered 100%). If not provided infinite progress is assumed and clients are allowed to ignore the percentage value in subsequent in report notifications.

The value should be steadily rising. Clients are free to ignore values that are not following this rule.

Kind
interface
Declaration
typings/index.d.ts:13182
types

WorkDoneProgressEnd

Interface exported by coc.nvim.

Source

Interface definition

export interface WorkDoneProgressEnd {
    kind: 'end';
    message?: string;
}

Members

kind: 'end';

Progress kind, always end.

message?: string;

Optional, a final message indicating to for example indicate the outcome of the operation.

Kind
interface
Declaration
typings/index.d.ts:13214
types

FileChangeType

Type alias exported by coc.nvim.

Source

Type definition

export type FileChangeType = 1 | 2 | 3;
Kind
type alias
Declaration
typings/index.d.ts:13244
types

FileEvent

An event describing a file change.

Source

Interface definition

export interface FileEvent {
    uri: string;
    type: FileChangeType;
}

Members

uri: string;

The file's uri.

type: FileChangeType;

The change type.

Kind
interface
Declaration
typings/index.d.ts:13249
types

ErrorAction

An action to be performed when the connection is producing errors.

Source

Enum definition

export enum ErrorAction {
    Continue = 1,
    Shutdown = 2
}

Members

Continue = 1

Continue running the server.

Shutdown = 2

Shutdown the server.

Kind
enum
Declaration
typings/index.d.ts:13262
types

CloseAction

An action to be performed when the connection to a server got closed.

Source

Enum definition

export enum CloseAction {
    DoNotRestart = 1,
    Restart = 2
}

Members

DoNotRestart = 1

Don't restart the server. The connection stays closed.

Restart = 2

Restart the server.

Kind
enum
Declaration
typings/index.d.ts:13275
types

CloseHandlerResult

Interface exported by coc.nvim.

Source

Interface definition

export interface CloseHandlerResult {
    action: CloseAction;
    message?: string;
    handled?: boolean;
}

Members

action: CloseAction;

The action to take.

message?: string;

An optional message to be presented to the user.

handled?: boolean;

If set to true the client assumes that the corresponding close handler has presented an appropriate message to the user and the message will only be log to the client's output channel.

Kind
interface
Declaration
typings/index.d.ts:13286
types

ErrorHandlerResult

Interface exported by coc.nvim.

Source

Interface definition

export interface ErrorHandlerResult {
    action: ErrorAction;
    message?: string;
    handled?: boolean;
}

Members

action: ErrorAction;

The action to take.

message?: string;

An optional message to be presented to the user.

handled?: boolean;

If set to true the client assumes that the corresponding error handler has presented an appropriate message to the user and the message will only be log to the client's output channel.

Kind
interface
Declaration
typings/index.d.ts:13306
types

ErrorHandler

A pluggable error handler that is invoked when the connection is either producing errors or got closed.

Source

Interface definition

export interface ErrorHandler {
    error(error: Error, message: {
        jsonrpc: string;
    }, count: number): ErrorAction | ErrorHandlerResult | Promise<ErrorHandlerResult>;
    closed(): CloseAction | CloseHandlerResult | Promise<CloseHandlerResult>;
}

Members

error(error: Error, message: { jsonrpc: string; }, count: number): ErrorAction | ErrorHandlerResult | Promise<ErrorHandlerResult>;

An error has occurred while writing or reading from the connection.

closed(): CloseAction | CloseHandlerResult | Promise<CloseHandlerResult>;

The connection to the server got closed. Use CloseHandlerResult should be preferred.

Kind
interface
Declaration
typings/index.d.ts:13329
types

InitializationFailedHandler

Interface exported by coc.nvim.

Source

Interface definition

export interface InitializationFailedHandler {
    (error: Error | any): boolean;
}

Members

(error: Error | any): boolean;
Kind
interface
Declaration
typings/index.d.ts:13346
types

RevealOutputChannelOn

Enum exported by coc.nvim.

Source

Enum definition

export enum RevealOutputChannelOn {
    Debug = 0,
    Info = 1,
    Warn = 2,
    Error = 3,
    Never = 4
}

Members

Debug = 0
Info = 1
Warn = 2
Error = 3
Never = 4
Kind
enum
Declaration
typings/index.d.ts:13361
types

ConfigurationItem

Interface exported by coc.nvim.

Source

Interface definition

export interface ConfigurationItem {
    scopeUri?: string;
    section?: string;
}

Members

scopeUri?: string;

The scope to get the configuration section for.

section?: string;

The configuration section asked for.

Kind
interface
Declaration
typings/index.d.ts:13368
types

ConfigurationWorkspaceMiddleware

Interface exported by coc.nvim.

Source

Interface definition

export interface ConfigurationWorkspaceMiddleware {
    configuration?: (params: ConfigurationParams, token: CancellationToken, next: RequestHandler<ConfigurationParams, any[], void>) => HandlerResult<any[], void>;
}

Members

configuration?: (params: ConfigurationParams, token: CancellationToken, next: RequestHandler<ConfigurationParams, any[], void>) => HandlerResult<any[], void>;

Middleware for the workspace configuration request.

Kind
interface
Declaration
typings/index.d.ts:13398
types

WorkspaceFolderWorkspaceMiddleware

Interface exported by coc.nvim.

Source

Interface definition

export interface WorkspaceFolderWorkspaceMiddleware {
    workspaceFolders?: (token: CancellationToken, next: RequestHandler0<WorkspaceFolder[] | null, void>) => HandlerResult<WorkspaceFolder[] | null, void>;
    didChangeWorkspaceFolders?: NextSignature<WorkspaceFoldersChangeEvent, Promise<void>>;
}

Members

workspaceFolders?: (token: CancellationToken, next: RequestHandler0<WorkspaceFolder[] | null, void>) => HandlerResult<WorkspaceFolder[] | null, void>;

Middleware for the workspace folders request.

didChangeWorkspaceFolders?: NextSignature<WorkspaceFoldersChangeEvent, Promise<void>>;

Middleware for workspace folder change events.

Kind
interface
Declaration
typings/index.d.ts:13405
types

TypeDefinitionMiddleware

Interface exported by coc.nvim.

Source

Interface definition

export interface TypeDefinitionMiddleware {
    provideTypeDefinition?: (this: void, document: LinesTextDocument, position: Position, token: CancellationToken, next: ProvideTypeDefinitionSignature) => ProviderResult<Definition | DefinitionLink[]>;
}

Members

provideTypeDefinition?: (this: void, document: LinesTextDocument, position: Position, token: CancellationToken, next: ProvideTypeDefinitionSignature) => ProviderResult<Definition | DefinitionLink[]>;

Middleware for providing type definitions.

Kind
interface
Declaration
typings/index.d.ts:13425
types

ImplementationMiddleware

Interface exported by coc.nvim.

Source

Interface definition

export interface ImplementationMiddleware {
    provideImplementation?: (this: void, document: LinesTextDocument, position: Position, token: CancellationToken, next: ProvideImplementationSignature) => ProviderResult<Definition | DefinitionLink[]>;
}

Members

provideImplementation?: (this: void, document: LinesTextDocument, position: Position, token: CancellationToken, next: ProvideImplementationSignature) => ProviderResult<Definition | DefinitionLink[]>;

Middleware for providing implementations.

Kind
interface
Declaration
typings/index.d.ts:13442
types

ColorProviderMiddleware

Interface exported by coc.nvim.

Source

Interface definition

export interface ColorProviderMiddleware {
    provideDocumentColors?: (this: void, document: LinesTextDocument, token: CancellationToken, next: ProvideDocumentColorsSignature) => ProviderResult<ColorInformation[]>;
    provideColorPresentations?: (this: void, color: Color, context: {
        document: LinesTextDocument;
        range: Range;
    }, token: CancellationToken, next: ProvideColorPresentationSignature) => ProviderResult<ColorPresentation[]>;
}

Members

provideDocumentColors?: (this: void, document: LinesTextDocument, token: CancellationToken, next: ProvideDocumentColorsSignature) => ProviderResult<ColorInformation[]>;

Middleware for providing document colors.

provideColorPresentations?: (this: void, color: Color, context: { document: LinesTextDocument; range: Range; }, token: CancellationToken, next: ProvideColorPresentationSignature) => ProviderResult<ColorPresentation[]>;

Middleware for providing color presentations.

Kind
interface
Declaration
typings/index.d.ts:13456
types

DeclarationMiddleware

Interface exported by coc.nvim.

Source

Interface definition

export interface DeclarationMiddleware {
    provideDeclaration?: (this: void, document: LinesTextDocument, position: Position, token: CancellationToken, next: ProvideDeclarationSignature) => ProviderResult<Declaration | DeclarationLink[]>;
}

Members

provideDeclaration?: (this: void, document: LinesTextDocument, position: Position, token: CancellationToken, next: ProvideDeclarationSignature) => ProviderResult<Declaration | DeclarationLink[]>;

Middleware for providing declarations.

Kind
interface
Declaration
typings/index.d.ts:13482
types

FoldingRangeProviderMiddleware

Interface exported by coc.nvim.

Source

Interface definition

export interface FoldingRangeProviderMiddleware {
    provideFoldingRanges?: (this: void, document: LinesTextDocument, context: FoldingContext, token: CancellationToken, next: ProvideFoldingRangeSignature) => ProviderResult<FoldingRange[]>;
}

Members

provideFoldingRanges?: (this: void, document: LinesTextDocument, context: FoldingContext, token: CancellationToken, next: ProvideFoldingRangeSignature) => ProviderResult<FoldingRange[]>;

Middleware for providing folding ranges.

Kind
interface
Declaration
typings/index.d.ts:13496
types

CallHierarchyMiddleware

Interface exported by coc.nvim.

Source

Interface definition

export interface CallHierarchyMiddleware {
    prepareCallHierarchy?: (this: void, document: LinesTextDocument, positions: Position, token: CancellationToken, next: PrepareCallHierarchySignature) => ProviderResult<CallHierarchyItem | CallHierarchyItem[]>;
    provideCallHierarchyIncomingCalls?: (this: void, item: CallHierarchyItem, token: CancellationToken, next: CallHierarchyIncomingCallsSignature) => ProviderResult<CallHierarchyIncomingCall[]>;
    provideCallHierarchyOutgoingCalls?: (this: void, item: CallHierarchyItem, token: CancellationToken, next: CallHierarchyOutgoingCallsSignature) => ProviderResult<CallHierarchyOutgoingCall[]>;
}

Members

prepareCallHierarchy?: (this: void, document: LinesTextDocument, positions: Position, token: CancellationToken, next: PrepareCallHierarchySignature) => ProviderResult<CallHierarchyItem | CallHierarchyItem[]>;

Middleware for preparing call hierarchies.

provideCallHierarchyIncomingCalls?: (this: void, item: CallHierarchyItem, token: CancellationToken, next: CallHierarchyIncomingCallsSignature) => ProviderResult<CallHierarchyIncomingCall[]>;

Middleware for providing incoming calls.

provideCallHierarchyOutgoingCalls?: (this: void, item: CallHierarchyItem, token: CancellationToken, next: CallHierarchyOutgoingCallsSignature) => ProviderResult<CallHierarchyOutgoingCall[]>;

Middleware for providing outgoing calls.

Kind
interface
Declaration
typings/index.d.ts:13520
types

DocumentSemanticsTokensEditsSignature

Interface exported by coc.nvim.

Source

Interface definition

export interface DocumentSemanticsTokensEditsSignature {
    (this: void, document: LinesTextDocument, previousResultId: string, token: CancellationToken): ProviderResult<SemanticTokens | SemanticTokensDelta>;
}

Members

(this: void, document: LinesTextDocument, previousResultId: string, token: CancellationToken): ProviderResult<SemanticTokens | SemanticTokensDelta>;
Kind
interface
Declaration
typings/index.d.ts:13555
types

SemanticTokensMiddleware

Interface exported by coc.nvim.

Source

Interface definition

export interface SemanticTokensMiddleware {
    provideDocumentSemanticTokens?: (this: void, document: LinesTextDocument, token: CancellationToken, next: DocumentSemanticsTokensSignature) => ProviderResult<SemanticTokens>;
    provideDocumentSemanticTokensEdits?: (this: void, document: LinesTextDocument, previousResultId: string, token: CancellationToken, next: DocumentSemanticsTokensEditsSignature) => ProviderResult<SemanticTokens | SemanticTokensDelta>;
    provideDocumentRangeSemanticTokens?: (this: void, document: LinesTextDocument, range: Range, token: CancellationToken, next: DocumentRangeSemanticTokensSignature) => ProviderResult<SemanticTokens>;
}

Members

provideDocumentSemanticTokens?: (this: void, document: LinesTextDocument, token: CancellationToken, next: DocumentSemanticsTokensSignature) => ProviderResult<SemanticTokens>;

Middleware for providing document semantic tokens.

provideDocumentSemanticTokensEdits?: (this: void, document: LinesTextDocument, previousResultId: string, token: CancellationToken, next: DocumentSemanticsTokensEditsSignature) => ProviderResult<SemanticTokens | SemanticTokensDelta>;

Middleware for providing semantic token edits.

provideDocumentRangeSemanticTokens?: (this: void, document: LinesTextDocument, range: Range, token: CancellationToken, next: DocumentRangeSemanticTokensSignature) => ProviderResult<SemanticTokens>;

Middleware for providing range semantic tokens.

Kind
interface
Declaration
typings/index.d.ts:13563
types

FileOperationsMiddleware

Interface exported by coc.nvim.

Source

Interface definition

export interface FileOperationsMiddleware {
    didCreateFiles?: NextSignature<FileCreateEvent, Promise<void>>;
    willCreateFiles?: NextSignature<FileWillCreateEvent, Thenable<WorkspaceEdit | null | undefined>>;
    didRenameFiles?: NextSignature<FileRenameEvent, Promise<void>>;
    willRenameFiles?: NextSignature<FileWillRenameEvent, Thenable<WorkspaceEdit | null | undefined>>;
    didDeleteFiles?: NextSignature<FileDeleteEvent, Promise<void>>;
    willDeleteFiles?: NextSignature<FileWillDeleteEvent, Thenable<WorkspaceEdit | null | undefined>>;
}

Members

didCreateFiles?: NextSignature<FileCreateEvent, Promise<void>>;

Middleware for file create events.

willCreateFiles?: NextSignature<FileWillCreateEvent, Thenable<WorkspaceEdit | null | undefined>>;

Middleware for file will-create events.

didRenameFiles?: NextSignature<FileRenameEvent, Promise<void>>;

Middleware for file rename events.

willRenameFiles?: NextSignature<FileWillRenameEvent, Thenable<WorkspaceEdit | null | undefined>>;

Middleware for file will-rename events.

didDeleteFiles?: NextSignature<FileDeleteEvent, Promise<void>>;

Middleware for file delete events.

willDeleteFiles?: NextSignature<FileWillDeleteEvent, Thenable<WorkspaceEdit | null | undefined>>;

Middleware for file will-delete events.

Kind
interface
Declaration
typings/index.d.ts:13595
types

LinkedEditingRangeMiddleware

Interface exported by coc.nvim.

Source

Interface definition

export interface LinkedEditingRangeMiddleware {
    provideLinkedEditingRange?: (this: void, document: LinesTextDocument, position: Position, token: CancellationToken, next: ProvideLinkedEditingRangeSignature) => ProviderResult<LinkedEditingRanges>;
}

Members

provideLinkedEditingRange?: (this: void, document: LinesTextDocument, position: Position, token: CancellationToken, next: ProvideLinkedEditingRangeSignature) => ProviderResult<LinkedEditingRanges>;

Middleware for providing linked editing ranges.

Kind
interface
Declaration
typings/index.d.ts:13626
types

SelectionRangeProviderMiddleware

Interface exported by coc.nvim.

Source

Interface definition

export interface SelectionRangeProviderMiddleware {
    provideSelectionRanges?: (this: void, document: LinesTextDocument, positions: Position[], token: CancellationToken, next: ProvideSelectionRangeSignature) => ProviderResult<SelectionRange[]>;
}

Members

provideSelectionRanges?: (this: void, document: LinesTextDocument, positions: Position[], token: CancellationToken, next: ProvideSelectionRangeSignature) => ProviderResult<SelectionRange[]>;

Middleware for providing selection ranges.

Kind
interface
Declaration
typings/index.d.ts:13643
types

DiagnosticProviderMiddleware

Interface exported by coc.nvim.

Source

Interface definition

export interface DiagnosticProviderMiddleware {
    provideDiagnostics?: (this: void, document: TextDocument, previousResultId: string | undefined, token: CancellationToken, next: ProvideDiagnosticSignature) => ProviderResult<DocumentDiagnosticReport>;
    provideWorkspaceDiagnostics?: (this: void, resultIds: PreviousResultId[], token: CancellationToken, resultReporter: ResultReporter, next: ProvideWorkspaceDiagnosticSignature) => ProviderResult<WorkspaceDiagnosticReport>;
}

Members

provideDiagnostics?: (this: void, document: TextDocument, previousResultId: string | undefined, token: CancellationToken, next: ProvideDiagnosticSignature) => ProviderResult<DocumentDiagnosticReport>;

Middleware for providing document diagnostics.

provideWorkspaceDiagnostics?: (this: void, resultIds: PreviousResultId[], token: CancellationToken, resultReporter: ResultReporter, next: ProvideWorkspaceDiagnosticSignature) => ProviderResult<WorkspaceDiagnosticReport>;

Middleware for providing workspace diagnostics.

Kind
interface
Declaration
typings/index.d.ts:13654
types

HandleDiagnosticsSignature

Interface exported by coc.nvim.

Source

Interface definition

export interface HandleDiagnosticsSignature {
    (this: void, uri: string, diagnostics: Diagnostic[]): void;
}

Members

(this: void, uri: string, diagnostics: Diagnostic[]): void;
Kind
interface
Declaration
typings/index.d.ts:13669
types

ProvideCompletionItemsSignature

Interface exported by coc.nvim.

Source

Interface definition

export interface ProvideCompletionItemsSignature {
    (this: void, document: LinesTextDocument, position: Position, context: CompletionContext, token: CancellationToken): ProviderResult<CompletionItem[] | CompletionList | null>;
}

Members

(this: void, document: LinesTextDocument, position: Position, context: CompletionContext, token: CancellationToken): ProviderResult<CompletionItem[] | CompletionList | null>;
Kind
interface
Declaration
typings/index.d.ts:13673
types

ProvideSignatureHelpSignature

Interface exported by coc.nvim.

Source

Interface definition

export interface ProvideSignatureHelpSignature {
    (this: void, document: LinesTextDocument, position: Position, context: SignatureHelpContext, token: CancellationToken): ProviderResult<SignatureHelp>;
}

Members

(this: void, document: LinesTextDocument, position: Position, context: SignatureHelpContext, token: CancellationToken): ProviderResult<SignatureHelp>;
Kind
interface
Declaration
typings/index.d.ts:13685
types

ProvideReferencesSignature

Interface exported by coc.nvim.

Source

Interface definition

export interface ProvideReferencesSignature {
    (this: void, document: LinesTextDocument, position: Position, options: {
        includeDeclaration: boolean;
    }, token: CancellationToken): ProviderResult<Location[]>;
}

Members

(this: void, document: LinesTextDocument, position: Position, options: { includeDeclaration: boolean; }, token: CancellationToken): ProviderResult<Location[]>;
Kind
interface
Declaration
typings/index.d.ts:13693
types

ProvideCodeActionsSignature

Interface exported by coc.nvim.

Source

Interface definition

export interface ProvideCodeActionsSignature {
    (this: void, document: LinesTextDocument, range: Range, context: CodeActionContext, token: CancellationToken): ProviderResult<(Command | CodeAction)[]>;
}

Members

(this: void, document: LinesTextDocument, range: Range, context: CodeActionContext, token: CancellationToken): ProviderResult<(Command | CodeAction)[]>;
Kind
interface
Declaration
typings/index.d.ts:13711
types

ProvideDocumentRangeFormattingEditsSignature

Interface exported by coc.nvim.

Source

Interface definition

export interface ProvideDocumentRangeFormattingEditsSignature {
    (this: void, document: LinesTextDocument, range: Range, options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;
}

Members

(this: void, document: LinesTextDocument, range: Range, options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;
Kind
interface
Declaration
typings/index.d.ts:13731
types

ProvideDocumentRangesFormattingEditsSignature

Interface exported by coc.nvim.

Source

Interface definition

export interface ProvideDocumentRangesFormattingEditsSignature {
    (this: void, document: LinesTextDocument, ranges: Range[], options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;
}

Members

(this: void, document: LinesTextDocument, ranges: Range[], options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;
Kind
interface
Declaration
typings/index.d.ts:13735
types

ProvideOnTypeFormattingEditsSignature

Interface exported by coc.nvim.

Source

Interface definition

export interface ProvideOnTypeFormattingEditsSignature {
    (this: void, document: LinesTextDocument, position: Position, ch: string, options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;
}

Members

(this: void, document: LinesTextDocument, position: Position, ch: string, options: FormattingOptions, token: CancellationToken): ProviderResult<TextEdit[]>;
Kind
interface
Declaration
typings/index.d.ts:13739
types

ExecuteCommandSignature

Interface exported by coc.nvim.

Source

Interface definition

export interface ExecuteCommandSignature {
    (this: void, command: string, args: any[]): ProviderResult<any>;
}

Members

(this: void, command: string, args: any[]): ProviderResult<any>;
Kind
interface
Declaration
typings/index.d.ts:13762
types

NextSignature

Interface exported by coc.nvim.

Source

Interface definition

export interface NextSignature<P, R> {
    (this: void, data: P, next: (data: P) => R): R;
}

Members

(this: void, data: P, next: (data: P) => R): R;
Kind
interface
Declaration
typings/index.d.ts:13766
types

DidChangeConfigurationSignature

Interface exported by coc.nvim.

Source

Interface definition

export interface DidChangeConfigurationSignature {
    (this: void, sections: string[] | undefined): void;
}

Members

(this: void, sections: string[] | undefined): void;
Kind
interface
Declaration
typings/index.d.ts:13770
types

DidChangeWatchedFileSignature

Interface exported by coc.nvim.

Source

Interface definition

export interface DidChangeWatchedFileSignature {
    (this: void, event: FileEvent): void;
}

Members

(this: void, event: FileEvent): void;
Kind
interface
Declaration
typings/index.d.ts:13774
types

ProvideInlineCompletionItemsSignature

Interface exported by coc.nvim.

Source

Interface definition

export interface ProvideInlineCompletionItemsSignature {
    (this: void, document: TextDocument, position: Position, context: InlineCompletionContext, token: CancellationToken): ProviderResult<InlineCompletionItem[] | InlineCompletionList>;
}

Members

Kind
interface
Declaration
typings/index.d.ts:13778
types

_WorkspaceMiddleware

Interface exported by coc.nvim.

Source

Interface definition

export interface _WorkspaceMiddleware {
    didChangeConfiguration?: (this: void, sections: string[] | undefined, next: DidChangeConfigurationSignature) => Promise<void>;
    didChangeWatchedFile?: (this: void, event: FileEvent, next: DidChangeWatchedFileSignature) => void;
    handleApplyEdit?: (this: void, params: ApplyWorkspaceEditParams, next: RequestHandler<ApplyWorkspaceEditParams, ApplyWorkspaceEditResult, void>) => HandlerResult<ApplyWorkspaceEditResult, void>;
}

Members

didChangeConfiguration?: (this: void, sections: string[] | undefined, next: DidChangeConfigurationSignature) => Promise<void>;

Middleware for configuration change notifications.

didChangeWatchedFile?: (this: void, event: FileEvent, next: DidChangeWatchedFileSignature) => void;

Middleware for watched file change notifications.

handleApplyEdit?: (this: void, params: ApplyWorkspaceEditParams, next: RequestHandler<ApplyWorkspaceEditParams, ApplyWorkspaceEditResult, void>) => HandlerResult<ApplyWorkspaceEditResult, void>;

Middleware for applying workspace edits.

Kind
interface
Declaration
typings/index.d.ts:13782
types

ShowDocumentParams

Params to show a document.

Source

Interface definition

export interface ShowDocumentParams {
    uri: string;
    external?: boolean;
    takeFocus?: boolean;
    selection?: Range;
}

Members

uri: string;

The document uri to show.

external?: boolean;

Indicates to show the resource in an external program. To show for example https://code.visualstudio.com/ in the default WEB browser set external to true.

takeFocus?: boolean;

An optional property to indicate whether the editor showing the document should take focus or not. Clients might ignore this property if an external program in started.

selection?: Range;

An optional selection range if the document is a text document. Clients might ignore the property if an external program is started or the file is not a text file.

Kind
interface
Declaration
typings/index.d.ts:13804
types

ShowDocumentResult

The result of an show document request.

Source

Interface definition

export interface ShowDocumentResult {
    success: boolean;
}

Members

success: boolean;

A boolean indicating if the show was successful.

Kind
interface
Declaration
typings/index.d.ts:13835
types

Registration

General parameters to register for a notification or to register a provider.

Source

Interface definition

export interface Registration {
    id: string;
    method: string;
    registerOptions?: LSPAny;
}

Members

id: string;

The id used to register the request. The id can be used to deregister the request again.

method: string;

The method / capability to register for.

registerOptions?: LSPAny;

Options necessary for the registration.

Kind
interface
Declaration
typings/index.d.ts:13845
types

RegistrationParams

Interface exported by coc.nvim.

Source

Interface definition

export interface RegistrationParams {
    registrations: Registration[];
}

Members

registrations: Registration[];

Registrations of the request.

Kind
interface
Declaration
typings/index.d.ts:13860
types

Unregistration

General parameters to unregister a request or notification.

Source

Interface definition

export interface Unregistration {
    id: string;
    method: string;
}

Members

id: string;

The id used to unregister the request or notification. Usually an id provided during the register request.

method: string;

The method to unregister for.

Kind
interface
Declaration
typings/index.d.ts:13870
types

UnregistrationParams

Interface exported by coc.nvim.

Source

Interface definition

export interface UnregistrationParams {
    unregisterations: Unregistration[];
}

Members

unregisterations: Unregistration[];

Unregistrations of the request.

Kind
interface
Declaration
typings/index.d.ts:13881
types

_WindowMiddleware

Interface exported by coc.nvim.

Source

Interface definition

export interface _WindowMiddleware {
    showDocument?: (params: ShowDocumentParams, token: CancellationToken, next: RequestHandler<ShowDocumentParams, ShowDocumentResult, void>) => Promise<ShowDocumentResult>;
}

Members

showDocument?: (params: ShowDocumentParams, token: CancellationToken, next: RequestHandler<ShowDocumentParams, ShowDocumentResult, void>) => Promise<ShowDocumentResult>;

Middleware for show document requests.

Kind
interface
Declaration
typings/index.d.ts:13888
types

_Middleware

The Middleware lets extensions intercept the request and notifications send and received from the server

Source

Interface definition

interface _Middleware {
    didOpen?: NextSignature<LinesTextDocument, Promise<void>>;
    didChange?: NextSignature<DidChangeTextDocumentParams, Promise<void>>;
    willSave?: NextSignature<TextDocumentWillSaveEvent, Promise<void>>;
    willSaveWaitUntil?: NextSignature<TextDocumentWillSaveEvent, Thenable<TextEdit[]>>;
    didSave?: NextSignature<LinesTextDocument, Promise<void>>;
    didClose?: NextSignature<LinesTextDocument, Promise<void>>;
    handleDiagnostics?: (this: void, uri: string, diagnostics: Diagnostic[], next: HandleDiagnosticsSignature) => void;
    provideCompletionItem?: (this: void, document: LinesTextDocument, position: Position, context: CompletionContext, token: CancellationToken, next: ProvideCompletionItemsSignature) => ProviderResult<CompletionItem[] | CompletionList | null>;
    resolveCompletionItem?: (this: void, item: CompletionItem, token: CancellationToken, next: ResolveCompletionItemSignature) => ProviderResult<CompletionItem>;
    provideHover?: (this: void, document: LinesTextDocument, position: Position, token: CancellationToken, next: ProvideHoverSignature) => ProviderResult<Hover>;
    provideSignatureHelp?: (this: void, document: LinesTextDocument, position: Position, context: SignatureHelpContext, token: CancellationToken, next: ProvideSignatureHelpSignature) => ProviderResult<SignatureHelp>;
    provideDefinition?: (this: void, document: LinesTextDocument, position: Position, token: CancellationToken, next: ProvideDefinitionSignature) => ProviderResult<Definition | DefinitionLink[]>;
    provideReferences?: (this: void, document: LinesTextDocument, position: Position, options: {
        includeDeclaration: boolean;
    }, token: CancellationToken, next: ProvideReferencesSignature) => ProviderResult<Location[]>;
    provideDocumentHighlights?: (this: void, document: LinesTextDocument, position: Position, token: CancellationToken, next: ProvideDocumentHighlightsSignature) => ProviderResult<DocumentHighlight[]>;
    provideDocumentSymbols?: (this: void, document: LinesTextDocument, token: CancellationToken, next: ProvideDocumentSymbolsSignature) => ProviderResult<SymbolInformation[] | DocumentSymbol[]>;
    provideWorkspaceSymbols?: (this: void, query: string, token: CancellationToken, next: ProvideWorkspaceSymbolsSignature) => ProviderResult<WorkspaceSymbol[]>;
    provideCodeActions?: (this: void, document: LinesTextDocument, range: Range, context: CodeActionContext, token: CancellationToken, next: ProvideCodeActionsSignature) => ProviderResult<(Command | CodeAction)[]>;
    handleWorkDoneProgress?: (this: void, token: ProgressToken, params: WorkDoneProgressBegin | WorkDoneProgressReport | WorkDoneProgressEnd, next: HandleWorkDoneProgressSignature) => void;
    handleRegisterCapability?: (this: void, params: RegistrationParams, next: RequestHandler<RegistrationParams, void, void>) => Promise<void>;
    handleUnregisterCapability?: (this: void, params: UnregistrationParams, next: RequestHandler<UnregistrationParams, void, void>) => Promise<void>;
    resolveCodeAction?: (this: void, item: CodeAction, token: CancellationToken, next: ResolveCodeActionSignature) => ProviderResult<CodeAction>;
    provideCodeLenses?: (this: void, document: LinesTextDocument, token: CancellationToken, next: ProvideCodeLensesSignature) => ProviderResult<CodeLens[]>;
    resolveCodeLens?: (this: void, codeLens: CodeLens, token: CancellationToken, next: ResolveCodeLensSignature) => ProviderResult<CodeLens>;
    provideDocumentFormattingEdits?: (this: void, document: LinesTextDocument, options: FormattingOptions, token: CancellationToken, next: ProvideDocumentFormattingEditsSignature) => ProviderResult<TextEdit[]>;
    provideDocumentRangeFormattingEdits?: (this: void, document: LinesTextDocument, range: Range, options: FormattingOptions, token: CancellationToken, next: ProvideDocumentRangeFormattingEditsSignature) => ProviderResult<TextEdit[]>;
    provideDocumentRangesFormattingEdits?: (this: void, document: LinesTextDocument, ranges: Range[], options: FormattingOptions, token: CancellationToken, next: ProvideDocumentRangesFormattingEditsSignature) => ProviderResult<TextEdit[]>;
    provideOnTypeFormattingEdits?: (this: void, document: LinesTextDocument, position: Position, ch: string, options: FormattingOptions, token: CancellationToken, next: ProvideOnTypeFormattingEditsSignature) => ProviderResult<TextEdit[]>;
    prepareRename?: (this: void, document: LinesTextDocument, position: Position, token: CancellationToken, next: PrepareRenameSignature) => ProviderResult<Range | {
        range: Range;
        placeholder: string;
    }>;
    provideRenameEdits?: (this: void, document: LinesTextDocument, position: Position, newName: string, token: CancellationToken, next: ProvideRenameEditsSignature) => ProviderResult<WorkspaceEdit>;
    provideDocumentLinks?: (this: void, document: LinesTextDocument, token: CancellationToken, next: ProvideDocumentLinksSignature) => ProviderResult<DocumentLink[]>;
    resolveDocumentLink?: (this: void, link: DocumentLink, token: CancellationToken, next: ResolveDocumentLinkSignature) => ProviderResult<DocumentLink>;
    executeCommand?: (this: void, command: string, args: any[], next: ExecuteCommandSignature) => ProviderResult<any>;
    workspace?: WorkspaceMiddleware;
    window?: WindowMiddleware;
}

Members

didOpen?: NextSignature<LinesTextDocument, Promise<void>>;

Middleware for document open notifications.

didChange?: NextSignature<DidChangeTextDocumentParams, Promise<void>>;

Middleware for document change notifications.

willSave?: NextSignature<TextDocumentWillSaveEvent, Promise<void>>;

Middleware for document will-save notifications.

willSaveWaitUntil?: NextSignature<TextDocumentWillSaveEvent, Thenable<TextEdit[]>>;

Middleware for document will-save-wait-until requests.

didSave?: NextSignature<LinesTextDocument, Promise<void>>;

Middleware for document save notifications.

didClose?: NextSignature<LinesTextDocument, Promise<void>>;

Middleware for document close notifications.

handleDiagnostics?: (this: void, uri: string, diagnostics: Diagnostic[], next: HandleDiagnosticsSignature) => void;

Middleware for diagnostics notifications.

provideCompletionItem?: (this: void, document: LinesTextDocument, position: Position, context: CompletionContext, token: CancellationToken, next: ProvideCompletionItemsSignature) => ProviderResult<CompletionItem[] | CompletionList | null>;

Middleware for providing completion items.

resolveCompletionItem?: (this: void, item: CompletionItem, token: CancellationToken, next: ResolveCompletionItemSignature) => ProviderResult<CompletionItem>;

Middleware for resolving completion items.

provideHover?: (this: void, document: LinesTextDocument, position: Position, token: CancellationToken, next: ProvideHoverSignature) => ProviderResult<Hover>;

Middleware for providing hover results.

provideSignatureHelp?: (this: void, document: LinesTextDocument, position: Position, context: SignatureHelpContext, token: CancellationToken, next: ProvideSignatureHelpSignature) => ProviderResult<SignatureHelp>;

Middleware for providing signature help.

provideDefinition?: (this: void, document: LinesTextDocument, position: Position, token: CancellationToken, next: ProvideDefinitionSignature) => ProviderResult<Definition | DefinitionLink[]>;

Middleware for providing definitions.

provideReferences?: (this: void, document: LinesTextDocument, position: Position, options: { includeDeclaration: boolean; }, token: CancellationToken, next: ProvideReferencesSignature) => ProviderResult<Location[]>;

Middleware for providing references.

provideDocumentHighlights?: (this: void, document: LinesTextDocument, position: Position, token: CancellationToken, next: ProvideDocumentHighlightsSignature) => ProviderResult<DocumentHighlight[]>;

Middleware for providing document highlights.

provideDocumentSymbols?: (this: void, document: LinesTextDocument, token: CancellationToken, next: ProvideDocumentSymbolsSignature) => ProviderResult<SymbolInformation[] | DocumentSymbol[]>;

Middleware for providing document symbols.

provideWorkspaceSymbols?: (this: void, query: string, token: CancellationToken, next: ProvideWorkspaceSymbolsSignature) => ProviderResult<WorkspaceSymbol[]>;

Middleware for providing workspace symbols.

provideCodeActions?: (this: void, document: LinesTextDocument, range: Range, context: CodeActionContext, token: CancellationToken, next: ProvideCodeActionsSignature) => ProviderResult<(Command | CodeAction)[]>;

Middleware for providing code actions.

handleWorkDoneProgress?: (this: void, token: ProgressToken, params: WorkDoneProgressBegin | WorkDoneProgressReport | WorkDoneProgressEnd, next: HandleWorkDoneProgressSignature) => void;

Middleware for work done progress notifications.

handleRegisterCapability?: (this: void, params: RegistrationParams, next: RequestHandler<RegistrationParams, void, void>) => Promise<void>;

Middleware for register capability requests.

handleUnregisterCapability?: (this: void, params: UnregistrationParams, next: RequestHandler<UnregistrationParams, void, void>) => Promise<void>;

Middleware for unregister capability requests.

resolveCodeAction?: (this: void, item: CodeAction, token: CancellationToken, next: ResolveCodeActionSignature) => ProviderResult<CodeAction>;

Middleware for resolving code actions.

provideCodeLenses?: (this: void, document: LinesTextDocument, token: CancellationToken, next: ProvideCodeLensesSignature) => ProviderResult<CodeLens[]>;

Middleware for providing code lenses.

resolveCodeLens?: (this: void, codeLens: CodeLens, token: CancellationToken, next: ResolveCodeLensSignature) => ProviderResult<CodeLens>;

Middleware for resolving code lenses.

provideDocumentFormattingEdits?: (this: void, document: LinesTextDocument, options: FormattingOptions, token: CancellationToken, next: ProvideDocumentFormattingEditsSignature) => ProviderResult<TextEdit[]>;

Middleware for providing document formatting edits.

provideDocumentRangeFormattingEdits?: (this: void, document: LinesTextDocument, range: Range, options: FormattingOptions, token: CancellationToken, next: ProvideDocumentRangeFormattingEditsSignature) => ProviderResult<TextEdit[]>;

Middleware for providing range formatting edits.

provideDocumentRangesFormattingEdits?: (this: void, document: LinesTextDocument, ranges: Range[], options: FormattingOptions, token: CancellationToken, next: ProvideDocumentRangesFormattingEditsSignature) => ProviderResult<TextEdit[]>;

Middleware for providing ranges formatting edits.

provideOnTypeFormattingEdits?: (this: void, document: LinesTextDocument, position: Position, ch: string, options: FormattingOptions, token: CancellationToken, next: ProvideOnTypeFormattingEditsSignature) => ProviderResult<TextEdit[]>;

Middleware for providing on-type formatting edits.

prepareRename?: (this: void, document: LinesTextDocument, position: Position, token: CancellationToken, next: PrepareRenameSignature) => ProviderResult<Range | { range: Range; placeholder: string; }>;

Middleware for preparing renames.

provideRenameEdits?: (this: void, document: LinesTextDocument, position: Position, newName: string, token: CancellationToken, next: ProvideRenameEditsSignature) => ProviderResult<WorkspaceEdit>;

Middleware for providing rename edits.

provideDocumentLinks?: (this: void, document: LinesTextDocument, token: CancellationToken, next: ProvideDocumentLinksSignature) => ProviderResult<DocumentLink[]>;

Middleware for providing document links.

resolveDocumentLink?: (this: void, link: DocumentLink, token: CancellationToken, next: ResolveDocumentLinkSignature) => ProviderResult<DocumentLink>;

Middleware for resolving document links.

executeCommand?: (this: void, command: string, args: any[], next: ExecuteCommandSignature) => ProviderResult<any>;

Middleware for executing commands.

workspace?: WorkspaceMiddleware;

Workspace middleware.

window?: WindowMiddleware;

Window middleware.

Kind
interface
Declaration
typings/index.d.ts:13904
types

GeneralMiddleware

Interface exported by coc.nvim.

Source

Interface definition

interface GeneralMiddleware {
    sendRequest?<P, R>(this: void, type: string | MessageSignature, param: P | undefined, token: CancellationToken | undefined, next: (type: string | MessageSignature, param?: P, token?: CancellationToken) => Promise<R>): Promise<R>;
    sendNotification?<R>(this: void, type: string | MessageSignature, next: (type: string | MessageSignature, params?: R) => Promise<void>, params: R): Promise<void>;
}

Members

sendRequest?<P, R>(this: void, type: string | MessageSignature, param: P | undefined, token: CancellationToken | undefined, next: (type: string | MessageSignature, param?: P, token?: CancellationToken) => Promise<R>): Promise<R>;

Middleware for sending requests.

sendNotification?<R>(this: void, type: string | MessageSignature, next: (type: string | MessageSignature, params?: R) => Promise<void>, params: R): Promise<void>;

Middleware for sending notifications.

Kind
interface
Declaration
typings/index.d.ts:14049
types

TextDocumentContentMiddleware

Interface exported by coc.nvim.

Source

Interface definition

export interface TextDocumentContentMiddleware {
    provideTextDocumentContent?: (this: void, uri: Uri, token: CancellationToken, next: ProvideTextDocumentContentSignature) => ProviderResult<string>;
}

Members

provideTextDocumentContent?: (this: void, uri: Uri, token: CancellationToken, next: ProvideTextDocumentContentSignature) => ProviderResult<string>;

Middleware for providing text document content.

Kind
interface
Declaration
typings/index.d.ts:14076
types

InlineCompletionMiddleware

Interface exported by coc.nvim.

Source

Interface definition

export interface InlineCompletionMiddleware {
    provideInlineCompletionItems?: (this: void, document: TextDocument, position: Position, context: InlineCompletionContext, token: CancellationToken, next: ProvideInlineCompletionItemsSignature) => ProviderResult<InlineCompletionItem[] | InlineCompletionList>;
}

Members

provideInlineCompletionItems?: (this: void, document: TextDocument, position: Position, context: InlineCompletionContext, token: CancellationToken, next: ProvideInlineCompletionItemsSignature) => ProviderResult<InlineCompletionItem[] | InlineCompletionList>;

Middleware for providing inline completion items.

Kind
interface
Declaration
typings/index.d.ts:14083
types

Middleware

Type alias exported by coc.nvim.

Source
types

ConnectionOptions

Interface exported by coc.nvim.

Source

Interface definition

export interface ConnectionOptions {
    maxRestartCount?: number;
}

Members

maxRestartCount?: number;

Maximum number of restart attempts before giving up.

Kind
interface
Declaration
typings/index.d.ts:14092
types

DiagnosticPullMode

Enum exported by coc.nvim.

Source

Enum definition

export enum DiagnosticPullMode {
    onType = 'onType',
    onSave = 'onSave',
    onFocus = 'onFocus'
}

Members

onType = 'onType'
onSave = 'onSave'
onFocus = 'onFocus'
Kind
enum
Declaration
typings/index.d.ts:14099
types

DiagnosticPullOptions

Interface exported by coc.nvim.

Source

Interface definition

export interface DiagnosticPullOptions {
    onChange?: boolean;
    onFocus?: boolean;
    onSave?: boolean;
    workspace?: boolean;
    ignored?: string[];
    filter?(document: {
        uri: string;
        languageId: string;
    }, mode: 'onType' | 'onSave'): boolean;
    match?(documentSelector: DocumentSelector, resource: Uri): boolean;
}

Members

onChange?: boolean;

Whether to pull for diagnostics on document change. Default to "pullDiagnostic.onChange" configuration.

onFocus?: boolean;

Whether to pull for diagnostics on editor focus.

onSave?: boolean;

Whether to pull for diagnostics on document save. Default to "pullDiagnostic.onSave" configuration.

workspace?: boolean;

Whether to pull for workspace diagnostics when possible. Default to "pullDiagnostic.workspace" configuration.

ignored?: string[];

Minimatch patterns to match full filepath that should be ignored for pullDiagnostic. Default to "pullDiagnostic.ignored" configuration.

filter?(document: { uri: string; languageId: string; }, mode: 'onType' | 'onSave'): boolean;

An optional filter method that is consulted when triggering a diagnostic pull during document change or document save.

The document gets filtered if the method returns true.

match?(documentSelector: DocumentSelector, resource: Uri): boolean;

An optional match method that is consulted when pulling for diagnostics when only a URI is known (e.g. for not instantiated tabs)

The method should return true if the document selector matches the given resource. See also the vscode.languages.match function.

Kind
interface
Declaration
typings/index.d.ts:14105
types

URIConverter

Interface exported by coc.nvim.

Source

Interface definition

export interface URIConverter {
    (value: Uri): string;
}

Members

(value: Uri): string;
Kind
interface
Declaration
typings/index.d.ts:14159
types

LanguageClientOptions

Interface exported by coc.nvim.

Source

Interface definition

export interface LanguageClientOptions {
    ignoredRootPaths?: string[];
    disableSnippetCompletion?: boolean;
    disableDynamicRegister?: boolean;
    disabledFeatures?: string[];
    formatterPriority?: number;
    documentSelector?: DocumentSelector | string[];
    synchronize?: SynchronizeOptions;
    diagnosticCollectionName?: string;
    outputChannelName?: string;
    outputChannel?: OutputChannel;
    traceOutputChannel?: OutputChannel;
    revealOutputChannelOn?: RevealOutputChannelOn;
    stdioEncoding?: string;
    uriConverter?: {
        code2Protocol: URIConverter;
    };
    initializationOptions?: any | (() => any);
    initializationFailedHandler?: InitializationFailedHandler;
    progressOnInitialization?: boolean;
    errorHandler?: ErrorHandler;
    middleware?: Middleware;
    workspaceFolder?: WorkspaceFolder;
    connectionOptions?: ConnectionOptions;
    diagnosticPullOptions?: DiagnosticPullOptions;
    textSynchronization?: {
        delayOpenNotifications?: boolean;
    };
    languageIdMap?: {
        [filename: string]: string;
    };
    markdown?: {
        isTrusted?: boolean;
        supportHtml?: boolean;
    };
}

Members

ignoredRootPaths?: string[];

Root paths that are ignored by the language client.

disableSnippetCompletion?: boolean;

Disable snippet completion when true.

disableDynamicRegister?: boolean;

Disable dynamic registration when true.

disabledFeatures?: string[];

Features disabled for the client.

formatterPriority?: number;

Priority of the formatter service.

documentSelector?: DocumentSelector | string[];

Document selector of the client.

synchronize?: SynchronizeOptions;

Synchronization options of the client.

diagnosticCollectionName?: string;

Name of the diagnostic collection.

outputChannelName?: string;

Name of the output channel.

outputChannel?: OutputChannel;

Output channel of the client.

traceOutputChannel?: OutputChannel;

Trace output channel of the client.

revealOutputChannelOn?: RevealOutputChannelOn;

When to reveal the output channel.

stdioEncoding?: string;

The encoding use to read stdout and stderr. Defaults to 'utf8' if omitted.

uriConverter?: { code2Protocol: URIConverter; };

Converter used to encode/decode uri.

initializationOptions?: any | (() => any);

Initialization options sent to the server.

initializationFailedHandler?: InitializationFailedHandler;

Handler invoked when initialization fails.

progressOnInitialization?: boolean;

Show progress while initializing when true.

errorHandler?: ErrorHandler;

Error handler of the client.

middleware?: Middleware;

Middleware of the client.

workspaceFolder?: WorkspaceFolder;

Workspace folder of the client.

connectionOptions?: ConnectionOptions;

Connection options of the client.

diagnosticPullOptions?: DiagnosticPullOptions;

Diagnostic pull options of the client.

textSynchronization?: { delayOpenNotifications?: boolean; };

Text synchronization options of the client.

languageIdMap?: { [filename: string]: string; };

Map of filename to languageId used when opening documents, e.g. { "application.yml": "spring-boot-properties-yaml" }.

markdown?: { isTrusted?: boolean; supportHtml?: boolean; };

Markdown options of the client.

Kind
interface
Declaration
typings/index.d.ts:14163
types

ClientState

Enum exported by coc.nvim.

Source

Enum definition

export enum ClientState {
    Initial,
    Starting,
    StartFailed,
    Running,
    Stopping,
    Stopped
}

Members

Initial
Starting
StartFailed
Running
Stopping
Stopped
Kind
enum
Declaration
typings/index.d.ts:14282
types

State

Enum exported by coc.nvim.

Source

Enum definition

export enum State {
    Stopped = 1,
    Running = 2,
    Starting = 3,
    StartFailed = 4
}

Members

Stopped = 1
Running = 2
Starting = 3
StartFailed = 4
Kind
enum
Declaration
typings/index.d.ts:14290
types

StateChangeEvent

Interface exported by coc.nvim.

Source

Interface definition

export interface StateChangeEvent {
    oldState: State;
    newState: State;
}

Members

oldState: State;

State before the change.

newState: State;

State after the change.

Kind
interface
Declaration
typings/index.d.ts:14296
types

RegistrationData

Interface exported by coc.nvim.

Source

Interface definition

export interface RegistrationData<T> {
    id: string;
    registerOptions: T;
}

Members

id: string;

Id of the registration.

registerOptions: T;

Register options of the registration.

Kind
interface
Declaration
typings/index.d.ts:14306
types

FeatureState

Type alias exported by coc.nvim.

Source

Type definition

export type FeatureState = {
    kind: 'document';
    id: string;
    registrations: boolean;
    matches: boolean;
} | {
    kind: 'workspace';
    id: string;
    registrations: boolean;
} | {
    kind: 'window';
    id: string;
    registrations: boolean;
} | {
    kind: 'static';
};
Kind
type alias
Declaration
typings/index.d.ts:14317
types

StaticFeature

A static feature. A static feature can't be dynamically activate via the server. It is wired during the initialize sequence.

Source

Interface definition

export interface StaticFeature {
    fillInitializeParams?: (params: object) => void;
    fillClientCapabilities(capabilities: object): void;
    preInitialize?: (capabilities: object, documentSelector: DocumentSelector | undefined) => void;
    initialize(capabilities: object, documentSelector: DocumentSelector | undefined): void;
    getState?(): FeatureState;
    dispose(): void;
}

Members

fillInitializeParams?: (params: object) => void;

Called to fill the initialize params.

fillClientCapabilities(capabilities: object): void;

Called to fill in the client capabilities this feature implements.

preInitialize?: (capabilities: object, documentSelector: DocumentSelector | undefined) => void;

A preflight where the server capabilities are shown to all features before a feature is actually initialized. This allows feature to capture some state if they are a pre-requisite for other features.

initialize(capabilities: object, documentSelector: DocumentSelector | undefined): void;

Initialize the feature. This method is called on a feature instance when the client has successfully received the initialize request from the server and before the client sends the initialized notification to the server.

getState?(): FeatureState;

Returns the state the feature is in.

dispose(): void;

Called when the client is stopped to dispose this feature. Usually a feature unregisters listeners registered hooked up with the VS Code extension host.

Kind
interface
Declaration
typings/index.d.ts:14369
types

DynamicFeature

A dynamic feature can be activated via the server.

Source

Interface definition

export interface DynamicFeature<RO> {
    fillInitializeParams?: (params: InitializeParams) => void;
    fillClientCapabilities(capabilities: any): void;
    initialize(capabilities: object, documentSelector: DocumentSelector | undefined): void;
    preInitialize?: (capabilities: object, documentSelector: DocumentSelector | undefined) => void;
    registrationType: RegistrationType<RO>;
    register(data: RegistrationData<RO>): void;
    unregister(id: string): void;
    getState?(): FeatureState;
    dispose(): void;
}

Members

fillInitializeParams?: (params: InitializeParams) => void;

Called to fill the initialize params.

fillClientCapabilities(capabilities: any): void;

Called to fill in the client capabilities this feature implements.

initialize(capabilities: object, documentSelector: DocumentSelector | undefined): void;

Initialize the feature. This method is called on a feature instance when the client has successfully received the initialize request from the server and before the client sends the initialized notification to the server.

preInitialize?: (capabilities: object, documentSelector: DocumentSelector | undefined) => void;

A preflight where the server capabilities are shown to all features before a feature is actually initialized. This allows feature to capture some state if they are a pre-requisite for other features.

registrationType: RegistrationType<RO>;

The signature (e.g. method) for which this features support dynamic activation / registration.

register(data: RegistrationData<RO>): void;

Is called when the server send a register request for the given message.

unregister(id: string): void;

Is called when the server wants to unregister a feature.

getState?(): FeatureState;

Returns the state the feature is in.

dispose(): void;

Called when the client is stopped to dispose this feature. Usually a feature unregisters listeners registered hooked up with the VS Code extension host.

Kind
interface
Declaration
typings/index.d.ts:14417
types

ParameterStructures

Class exported by coc.nvim.

Source

Class definition

class ParameterStructures {
    private readonly kind;
    static readonly auto: ParameterStructures;
    static readonly byPosition: ParameterStructures;
    static readonly byName: ParameterStructures;
    private constructor();
    static is(value: any): value is ParameterStructures;
    toString(): string;
}

Members

private readonly kind;
static readonly auto: ParameterStructures;

The parameter structure is automatically inferred on the number of parameters and the parameter type in case of a single param.

static readonly byPosition: ParameterStructures;

Forces byPosition parameter structure. This is useful if you have a single parameter which has a literal type.

static readonly byName: ParameterStructures;

Forces byName parameter structure. This is only useful when having a single parameter. The library will report errors if used with a different number of parameters.

private constructor();
static is(value: any): value is ParameterStructures;

Checks whether the given value is a ParameterStructures.

toString(): string;

String representation of the parameter structure.

Kind
class
Declaration
typings/index.d.ts:14479
types

MessageSignature

An interface to type messages.

Source

Interface definition

export interface MessageSignature {
    readonly method: string;
    readonly numberOfParams: number;
    readonly parameterStructures: ParameterStructures;
}

Members

readonly method: string;

Method name of the message.

readonly numberOfParams: number;

Number of parameters of the message.

readonly parameterStructures: ParameterStructures;

Parameter structure of the message.

Kind
interface
Declaration
typings/index.d.ts:14510
types

AbstractMessageSignature

An abstract implementation of a MessageType.

Source

Class definition

abstract class AbstractMessageSignature implements MessageSignature {
    readonly method: string;
    readonly numberOfParams: number;
    constructor(method: string, numberOfParams: number);
    get parameterStructures(): ParameterStructures;
}

Members

readonly method: string;

Method name of the message.

readonly numberOfParams: number;

Number of parameters of the message.

constructor(method: string, numberOfParams: number);
get parameterStructures(): ParameterStructures;

Parameter structure of the message.

Kind
class
Declaration
typings/index.d.ts:14529
types

RequestType0

Classes to type request response pairs

Source

Class definition

export class RequestType0<R, E> extends AbstractMessageSignature {
    readonly _: [
        R,
        E,
        _EM
    ] | undefined;
    constructor(method: string);
}

Members

readonly _: [ R, E, _EM ] | undefined;

Clients must not use this property. It is here to ensure correct typing.

constructor(method: string);
Kind
class
Declaration
typings/index.d.ts:14548
types

RequestType

Class exported by coc.nvim.

Source

Class definition

export class RequestType<P, R, E> extends AbstractMessageSignature {
    private _parameterStructures;
    readonly _: [
        P,
        R,
        E,
        _EM
    ] | undefined;
    constructor(method: string, _parameterStructures?: ParameterStructures);
    get parameterStructures(): ParameterStructures;
}

Members

private _parameterStructures;
readonly _: [ P, R, E, _EM ] | undefined;

Clients must not use this property. It is here to ensure correct typing.

constructor(method: string, _parameterStructures?: ParameterStructures);
get parameterStructures(): ParameterStructures;

Parameter structure of the request.

Kind
class
Declaration
typings/index.d.ts:14556
types

NotificationType

Class exported by coc.nvim.

Source

Class definition

export class NotificationType<P> extends AbstractMessageSignature {
    readonly _: [
        P,
        _EM
    ] | undefined;
    constructor(method: string);
}

Members

readonly _: [ P, _EM ] | undefined;

Clients must not use this property. It is here to ensure correct typing.

constructor(method: string);
Kind
class
Declaration
typings/index.d.ts:14569
types

NotificationType0

Class exported by coc.nvim.

Source

Class definition

export class NotificationType0 extends AbstractMessageSignature {
    readonly _: [
        _EM
    ] | undefined;
    constructor(method: string);
}

Members

readonly _: [ _EM ] | undefined;

Clients must not use this property. It is here to ensure correct typing.

constructor(method: string);
Kind
class
Declaration
typings/index.d.ts:14577
types

InitializeParams

Interface exported by coc.nvim.

Source

Interface definition

export interface InitializeParams {
    processId: number | null;
    clientInfo?: {
        name: string;
        version?: string;
    };
    rootPath?: string | null;
    rootUri: string | null;
    capabilities: any;
    initializationOptions?: any;
    trace?: 'off' | 'messages' | 'verbose';
    workDoneToken?: ProgressToken;
}

Members

processId: number | null;

The process Id of the parent process that started the server.

clientInfo?: { name: string; version?: string; };

Information about the client

rootPath?: string | null;

The rootPath of the workspace. Is null if no folder is open.

rootUri: string | null;

The rootUri of the workspace. Is null if no folder is open. If both rootPath and rootUri are set rootUri wins.

capabilities: any;

The capabilities provided by the client (editor or tool)

initializationOptions?: any;

User provided initialization options.

trace?: 'off' | 'messages' | 'verbose';

The initial trace setting. If omitted trace is disabled ('off').

workDoneToken?: ProgressToken;

An optional token that a server can use to report work done progress.

Kind
interface
Declaration
typings/index.d.ts:14585
types

RegistrationType

Class exported by coc.nvim.

Source

Class definition

class RegistrationType<RO> {
    readonly ____: [
        RO,
        _EM
    ] | undefined;
    readonly method: string;
    constructor(method: string);
}

Members

readonly ____: [ RO, _EM ] | undefined;

Clients must not use this property. It is here to ensure correct typing.

readonly method: string;

Method name of the registration type.

constructor(method: string);
Kind
class
Declaration
typings/index.d.ts:14639
types

InitializeResult

The result returned from an initialize request.

Source

Interface definition

export interface InitializeResult {
    capabilities: any;
    serverInfo?: {
        name: string;
        version?: string;
    };
    [custom: string]: any;
}

Members

capabilities: any;

The capabilities the language server provides.

serverInfo?: { name: string; version?: string; };

Information about the server.

[custom: string]: any;

Custom initialization results.

Kind
interface
Declaration
typings/index.d.ts:14653
types

NotificationFeature

Interface exported by coc.nvim.

Source

Interface definition

export interface NotificationFeature<T extends Function> {
    getProvider(document: {
        uri: string;
        languageId: string;
    }): {
        send: T;
    };
}

Members

getProvider(document: { uri: string; languageId: string; }): { send: T; };

Triggers the corresponding RPC method.

Kind
interface
Declaration
typings/index.d.ts:14679
types

ExecutableOptions

Interface exported by coc.nvim.

Source

Interface definition

export interface ExecutableOptions {
    cwd?: string;
    env?: any;
    detached?: boolean;
    shell?: boolean;
}

Members

cwd?: string;

Working directory of the process.

env?: any;

Environment variables of the process.

detached?: boolean;

Detach the process from the parent.

shell?: boolean;

Use a shell to run the process.

Kind
interface
Declaration
typings/index.d.ts:14688
types

Executable

Interface exported by coc.nvim.

Source

Interface definition

export interface Executable {
    command: string;
    args?: string[];
    options?: ExecutableOptions;
}

Members

command: string;

Command of the executable.

args?: string[];

Arguments of the command.

options?: ExecutableOptions;

Options of the executable.

Kind
interface
Declaration
typings/index.d.ts:14707
types

ForkOptions

Interface exported by coc.nvim.

Source

Interface definition

export interface ForkOptions {
    cwd?: string;
    env?: any;
    execPath?: string;
    encoding?: string;
    execArgv?: string[];
}

Members

cwd?: string;

Working directory of the process.

env?: any;

Environment variables of the process.

execPath?: string;

Path of the executable.

encoding?: string;

Encoding of the process output.

execArgv?: string[];

Arguments passed to the executable.

Kind
interface
Declaration
typings/index.d.ts:14722
types

StreamInfo

Interface exported by coc.nvim.

Source

Interface definition

export interface StreamInfo {
    writer: NodeJS.WritableStream;
    reader: NodeJS.ReadableStream;
    detached?: boolean;
}

Members

writer: NodeJS.WritableStream;

Writable stream of the server.

reader: NodeJS.ReadableStream;

Readable stream of the server.

detached?: boolean;

Detach the streams from the parent.

Kind
interface
Declaration
typings/index.d.ts:14745
types

TransportKind

Enum exported by coc.nvim.

Source

Enum definition

export enum TransportKind {
    stdio = 0,
    ipc = 1,
    pipe = 2,
    socket = 3
}

Members

stdio = 0
ipc = 1
pipe = 2
socket = 3
Kind
enum
Declaration
typings/index.d.ts:14760
types

SocketTransport

Interface exported by coc.nvim.

Source

Interface definition

export interface SocketTransport {
    kind: TransportKind.socket;
    port: number;
}

Members

kind: TransportKind.socket;

Transport kind, always socket.

port: number;

Port of the socket.

Kind
interface
Declaration
typings/index.d.ts:14767
types

NodeModule

Interface exported by coc.nvim.

Source

Interface definition

export interface NodeModule {
    module: string;
    transport?: TransportKind | SocketTransport;
    args?: string[];
    runtime?: string;
    options?: ForkOptions;
}

Members

module: string;

Module path of the server.

transport?: TransportKind | SocketTransport;

Transport of the server.

args?: string[];

Arguments of the server.

runtime?: string;

Runtime of the server.

options?: ForkOptions;

Fork options of the server.

Kind
interface
Declaration
typings/index.d.ts:14778
types

ChildProcessInfo

Interface exported by coc.nvim.

Source

Interface definition

export interface ChildProcessInfo {
    process: cp.ChildProcess;
    detached: boolean;
}

Members

process: cp.ChildProcess;

Child process of the server.

detached: boolean;

Whether the process is detached.

Kind
interface
Declaration
typings/index.d.ts:14801
types

PartialMessageInfo

Interface exported by coc.nvim.

Source

Interface definition

export interface PartialMessageInfo {
    readonly messageToken: number;
    readonly waitingTime: number;
}

Members

readonly messageToken: number;

Token of the partial message.

readonly waitingTime: number;

Waiting time of the partial message.

Kind
interface
Declaration
typings/index.d.ts:14812
types

MessageReader

Interface exported by coc.nvim.

Source

Interface definition

export interface MessageReader {
    readonly onError: Event<Error>;
    readonly onClose: Event<void>;
    readonly onPartialMessage: Event<PartialMessageInfo>;
    listen(callback: (data: {
        jsonrpc: string;
    }) => void): void;
    dispose(): void;
}

Members

readonly onError: Event<Error>;

Fired on error.

readonly onClose: Event<void>;

Fired on close.

readonly onPartialMessage: Event<PartialMessageInfo>;

Fired on partial message.

listen(callback: (data: { jsonrpc: string; }) => void): void;

Start listening for messages.

dispose(): void;

Dispose the reader.

Kind
interface
Declaration
typings/index.d.ts:14823
types

MessageWriter

Interface exported by coc.nvim.

Source

Interface definition

export interface MessageWriter {
    readonly onError: Event<[
        Error,
        {
            jsonrpc: string;
        } | undefined,
        number | undefined
    ]>;
    readonly onClose: Event<void>;
    write(msg: {
        jsonrpc: string;
    }): void;
    dispose(): void;
}

Members

readonly onError: Event<[ Error, { jsonrpc: string; } | undefined, number | undefined ]>;

Fired on error.

readonly onClose: Event<void>;

Fired on close.

write(msg: { jsonrpc: string; }): void;

Write a message.

dispose(): void;

Dispose the writer.

Kind
interface
Declaration
typings/index.d.ts:14846
types

NullLogger

Class exported by coc.nvim.

Source

Class definition

export class NullLogger {
    constructor();
    error(message: string): void;
    warn(message: string): void;
    info(message: string): void;
    log(message: string): void;
}

Members

constructor();
error(message: string): void;

Log an error message.

warn(message: string): void;

Log a warning message.

info(message: string): void;

Log an info message.

log(message: string): void;

Log a message.

Kind
class
Declaration
typings/index.d.ts:14865
types

MessageTransports

Interface exported by coc.nvim.

Source

Interface definition

export interface MessageTransports {
    reader: MessageReader;
    writer: MessageWriter;
    detached?: boolean;
}

Members

reader: MessageReader;

Message reader of the transport.

writer: MessageWriter;

Message writer of the transport.

detached?: boolean;

Whether the transport is detached.

Kind
interface
Declaration
typings/index.d.ts:14885
types

_EM

Interface exported by coc.nvim.

Source

Interface definition

export interface _EM {
    _$endMarker$_: number;
}

Members

_$endMarker$_: number;

End marker used for typing only.

Kind
interface
Declaration
typings/index.d.ts:14915
types

ProgressType

Class exported by coc.nvim.

Source

Class definition

export class ProgressType<PR> {
    readonly __?: [
        PR,
        _EM
    ];
    readonly _pr?: PR;
    constructor();
}

Members

readonly __?: [ PR, _EM ];

Clients must not use these properties. They are here to ensure correct typing. in TypeScript

readonly _pr?: PR;

Typing marker, do not use.

constructor();
Kind
class
Declaration
typings/index.d.ts:14922
types

Trace

Enum exported by coc.nvim.

Source

Enum definition

export enum Trace {
    Off = 0,
    Messages = 1,
    Compact = 2,
    Verbose = 3
}

Members

Off = 0
Messages = 1
Compact = 2
Verbose = 3
Kind
enum
Declaration
typings/index.d.ts:14935
types

RequestProtocolSignature

Interface exported by coc.nvim.

Source

Interface definition

export interface RequestProtocolSignature<P, R, PR, E, RO> {
    method: string;
    numberOfParams?: number;
    parameterStructures?: unknown;
}

Members

method: string;

Method name of the request.

numberOfParams?: number;

Number of parameters of the request.

parameterStructures?: unknown;

Parameter structure of the request.

Kind
interface
Declaration
typings/index.d.ts:14947
types

RequestProtocolSignature0

Interface exported by coc.nvim.

Source

Interface definition

export interface RequestProtocolSignature0<R, PR, E, RO> {
    method: string;
}

Members

method: string;

Method name of the request.

Kind
interface
Declaration
typings/index.d.ts:14962
types

RequestSignature

Interface exported by coc.nvim.

Source

Interface definition

export interface RequestSignature<P, R, E> {
    method: string;
    numberOfParams?: number;
    parameterStructures?: unknown;
}

Members

method: string;

Method name of the request.

numberOfParams?: number;

Number of parameters of the request.

parameterStructures?: unknown;

Parameter structure of the request.

Kind
interface
Declaration
typings/index.d.ts:14969
types

RequestSignature0

Interface exported by coc.nvim.

Source

Interface definition

export interface RequestSignature0<R, E> {
    method: string;
}

Members

method: string;

Method name of the request.

Kind
interface
Declaration
typings/index.d.ts:14984
types

NotificationProtocolSignature

Interface exported by coc.nvim.

Source

Interface definition

export interface NotificationProtocolSignature<P, RO> {
    method: string;
    numberOfParams?: number;
    parameterStructures?: unknown;
}

Members

method: string;

Method name of the notification.

numberOfParams?: number;

Number of parameters of the notification.

parameterStructures?: unknown;

Parameter structure of the notification.

Kind
interface
Declaration
typings/index.d.ts:14991
types

NotificationProtocolSignature0

Interface exported by coc.nvim.

Source

Interface definition

export interface NotificationProtocolSignature0<RO> {
    readonly ____: [
        RO,
        _EM
    ] | undefined;
    method: string;
}

Members

readonly ____: [ RO, _EM ] | undefined;

Typing marker, do not use.

method: string;

Method name of the notification.

Kind
interface
Declaration
typings/index.d.ts:15006
types

NotificationSignature

Interface exported by coc.nvim.

Source

Interface definition

export interface NotificationSignature<P> {
    readonly _: [
        P,
        _EM
    ] | undefined;
    method: string;
    numberOfParams?: number;
    parameterStructures?: unknown;
}

Members

readonly _: [ P, _EM ] | undefined;

Typing marker, do not use.

method: string;

Method name of the notification.

numberOfParams?: number;

Number of parameters of the notification.

parameterStructures?: unknown;

Parameter structure of the notification.

Kind
interface
Declaration
typings/index.d.ts:15017
types

NotificationSignature0

Interface exported by coc.nvim.

Source

Interface definition

export interface NotificationSignature0 {
    method: string;
}

Members

method: string;

Method name of the notification.

Kind
interface
Declaration
typings/index.d.ts:15036
types

ProtocolRequestType0

Class exported by coc.nvim.

Source

Class definition

export class ProtocolRequestType0<R, PR, E, RO> extends RequestType0<R, E> implements ProgressType<PR>, RegistrationType<RO> {
    readonly ___: [
        PR,
        RO,
        _EM
    ] | undefined;
    readonly ____: [
        RO,
        _EM
    ] | undefined;
    readonly _pr: PR | undefined;
    constructor(method: string);
}

Members

readonly ___: [ PR, RO, _EM ] | undefined;

Clients must not use these properties. They are here to ensure correct typing. in TypeScript

readonly ____: [ RO, _EM ] | undefined;

Typing marker, do not use.

readonly _pr: PR | undefined;

Typing marker, do not use.

constructor(method: string);
Kind
class
Declaration
typings/index.d.ts:15043
types

ProtocolRequestType

Class exported by coc.nvim.

Source

Class definition

export class ProtocolRequestType<P, R, PR, E, RO> extends RequestType<P, R, E> implements ProgressType<PR>, RegistrationType<RO> {
    readonly ___: [
        PR,
        RO,
        _EM
    ] | undefined;
    readonly ____: [
        RO,
        _EM
    ] | undefined;
    readonly _pr: PR | undefined;
    constructor(method: string);
}

Members

readonly ___: [ PR, RO, _EM ] | undefined;

Clients must not use this property. It is here to ensure correct typing.

readonly ____: [ RO, _EM ] | undefined;

Typing marker, do not use.

readonly _pr: PR | undefined;

Typing marker, do not use.

constructor(method: string);
Kind
class
Declaration
typings/index.d.ts:15060
types

ProtocolNotificationType0

Class exported by coc.nvim.

Source

Class definition

export class ProtocolNotificationType0<RO> extends NotificationType0 implements RegistrationType<RO> {
    readonly ___: [
        RO,
        _EM
    ] | undefined;
    readonly ____: [
        RO,
        _EM
    ] | undefined;
    constructor(method: string);
}

Members

readonly ___: [ RO, _EM ] | undefined;

Clients must not use this property. It is here to ensure correct typing.

readonly ____: [ RO, _EM ] | undefined;

Typing marker, do not use.

constructor(method: string);
Kind
class
Declaration
typings/index.d.ts:15076
types

ProtocolNotificationType

Class exported by coc.nvim.

Source

Class definition

export class ProtocolNotificationType<P, RO> extends NotificationType<P> implements RegistrationType<RO> {
    readonly ___: [
        RO,
        _EM
    ] | undefined;
    readonly ____: [
        RO,
        _EM
    ] | undefined;
    constructor(method: string);
}

Members

readonly ___: [ RO, _EM ] | undefined;

Clients must not use this property. It is here to ensure correct typing.

readonly ____: [ RO, _EM ] | undefined;

Typing marker, do not use.

constructor(method: string);
Kind
class
Declaration
typings/index.d.ts:15087
types

NotificationHandler0

Interface exported by coc.nvim.

Source

Interface definition

export interface NotificationHandler0 {
    (): void;
}

Members

(): void;
Kind
interface
Declaration
typings/index.d.ts:15099
types

NotificationHandler

Interface exported by coc.nvim.

Source

Interface definition

export interface NotificationHandler<P> {
    (params: P): void;
}

Members

(params: P): void;
Kind
interface
Declaration
typings/index.d.ts:15103
types

GeneralRegistrationOptions

Including the registration options from languageserver protocol package could be too complicated and the options can be changed from time to time.

Source

Interface definition

export interface GeneralRegistrationOptions {
    [key: string]: any;
}

Members

[key: string]: any;
Kind
interface
Declaration
typings/index.d.ts:15111
types

DidChangeConfigurationRegistrationOptions

Interface exported by coc.nvim.

Source

Interface definition

export interface DidChangeConfigurationRegistrationOptions {
    section?: string | string[];
}

Members

section?: string | string[];

Configuration sections that changed.

Kind
interface
Declaration
typings/index.d.ts:15122
types

TextDocumentRegistrationOptions

Interface exported by coc.nvim.

Source

Interface definition

interface TextDocumentRegistrationOptions {
    documentSelector: DocumentSelector | null;
}

Members

documentSelector: DocumentSelector | null;

A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.

Kind
interface
Declaration
typings/index.d.ts:15129
types

TextDocumentChangeRegistrationOptions

Interface exported by coc.nvim.

Source

Interface definition

interface TextDocumentChangeRegistrationOptions {
    syncKind: 0 | 1 | 2;
}

Members

syncKind: 0 | 1 | 2;

How documents are synced to the server.

Kind
interface
Declaration
typings/index.d.ts:15137
types

TextDocumentSendFeature

Interface exported by coc.nvim.

Source

Interface definition

interface TextDocumentSendFeature<T extends Function> {
    getProvider(document: TextDocument): {
        send: T;
    } | undefined;
}

Members

getProvider(document: TextDocument): { send: T; } | undefined;

Returns a provider for the given text document.

Kind
interface
Declaration
typings/index.d.ts:15144
types

DidOpenTextDocumentFeatureShape

Interface exported by coc.nvim.

Source

Interface definition

export interface DidOpenTextDocumentFeatureShape extends DynamicFeature<TextDocumentRegistrationOptions>, TextDocumentSendFeature<(textDocument: TextDocument) => Promise<void>>, NotifyingFeature<TextDocument, DidOpenTextDocumentParams> {
    openDocuments: Iterable<TextDocument>;
}

Members

openDocuments: Iterable<TextDocument>;

Documents currently opened by the feature.

Kind
interface
Declaration
typings/index.d.ts:15180
types

WorkspaceProviderFeature

Interface exported by coc.nvim.

Source

Interface definition

export interface WorkspaceProviderFeature<PR> {
    getProviders(): PR[] | undefined;
}

Members

getProviders(): PR[] | undefined;

Get the registered providers.

Kind
interface
Declaration
typings/index.d.ts:15209
types

TextDocumentProviderFeature

Interface exported by coc.nvim.

Source

Interface definition

export interface TextDocumentProviderFeature<T> {
    readonly registrationLength: number;
    getProvider(textDocument: TextDocument): T | undefined;
}

Members

readonly registrationLength: number;

Number of registered providers.

getProvider(textDocument: TextDocument): T | undefined;

Triggers the corresponding RPC method.

Kind
interface
Declaration
typings/index.d.ts:15216
types

CodeLensProviderShape

Interface exported by coc.nvim.

Source

Interface definition

export interface CodeLensProviderShape {
    provider?: CodeLensProvider;
    onDidChangeCodeLensEmitter: Emitter<void>;
}

Members

provider?: CodeLensProvider;

Provider of code lenses.

onDidChangeCodeLensEmitter: Emitter<void>;

Emitter fired when code lenses change.

Kind
interface
Declaration
typings/index.d.ts:15227
types

SemanticTokensProviderShape

Interface exported by coc.nvim.

Source

Interface definition

export interface SemanticTokensProviderShape {
    range?: DocumentRangeSemanticTokensProvider;
    full?: DocumentSemanticTokensProvider;
    onDidChangeSemanticTokensEmitter: Emitter<void>;
}

Members

range?: DocumentRangeSemanticTokensProvider;

Provider of range semantic tokens.

full?: DocumentSemanticTokensProvider;

Provider of full document semantic tokens.

onDidChangeSemanticTokensEmitter: Emitter<void>;

Emitter fired when semantic tokens change.

Kind
interface
Declaration
typings/index.d.ts:15238
types

DiagnosticProviderShape

Interface exported by coc.nvim.

Source

Interface definition

export interface DiagnosticProviderShape {
    onDidChangeDiagnosticsEmitter: Emitter<void>;
    diagnostics: DiagnosticProvider;
    forget(document: TextDocument): void;
}

Members

onDidChangeDiagnosticsEmitter: Emitter<void>;

An event that signals that the diagnostics should be refreshed for all documents.

diagnostics: DiagnosticProvider;

The provider of diagnostics.

forget(document: TextDocument): void;

Forget the given document and remove all diagnostics.

Kind
interface
Declaration
typings/index.d.ts:15286
types

DiagnosticFeatureShape

Interface exported by coc.nvim.

Source

Interface definition

export interface DiagnosticFeatureShape {
    refresh(): void;
}

Members

refresh(): void;

Refresh all diagnostics.

Kind
interface
Declaration
typings/index.d.ts:15304
types

LanguageClient

A language server for manage a language server. It's recommended to use services.registerLanguageClient to register language client to serviers, you can have language client listed in CocList services and services could start the language client by documentselector of clientOptions.

Source

Class definition

export class LanguageClient {
    readonly id: string;
    readonly name: string;
    constructor(id: string, name: string, serverOptions: ServerOptions, clientOptions: LanguageClientOptions, forceDebug?: boolean);
    constructor(name: string, serverOptions: ServerOptions, clientOptions: LanguageClientOptions, forceDebug?: boolean);
    sendRequest<R, PR, E, RO>(type: ProtocolRequestType0<R, PR, E, RO> | RequestProtocolSignature0<R, PR, E, RO>, token?: CancellationToken): Promise<R>;
    sendRequest<P, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO> | RequestProtocolSignature<P, R, PR, E, RO>, params: P, token?: CancellationToken): Promise<R>;
    sendRequest<R, E>(type: RequestType0<R, E> | RequestSignature0<R, E>, token?: CancellationToken): Promise<R>;
    sendRequest<P, R, E>(type: RequestType<P, R, E> | RequestSignature<P, R, E>, params: P, token?: CancellationToken): Promise<R>;
    sendRequest<R>(method: string, token?: CancellationToken): Promise<R>;
    sendRequest<R>(method: string, param: any, token?: CancellationToken): Promise<R>;
    onRequest<R, PR, E, RO>(type: ProtocolRequestType0<R, PR, E, RO>, handler: RequestHandler0<R, E>): Disposable;
    onRequest<P, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO>, handler: RequestHandler<P, R, E>): Disposable;
    onRequest<R, E>(type: RequestType0<R, E>, handler: RequestHandler0<R, E>): Disposable;
    onRequest<P, R, E>(type: RequestType<P, R, E>, handler: RequestHandler<P, R, E>): Disposable;
    onRequest<R, E>(method: string, handler: (...params: any[]) => HandlerResult<R, E>): Disposable;
    sendNotification<RO>(type: ProtocolNotificationType0<RO> | NotificationProtocolSignature0<RO>): Promise<void>;
    sendNotification<P, RO>(type: ProtocolNotificationType<P, RO> | NotificationSignature<P>, params?: P): Promise<void>;
    sendNotification(type: NotificationType0 | NotificationSignature0): Promise<void>;
    sendNotification<P>(type: NotificationType<P> | NotificationSignature<P>, params?: P): Promise<void>;
    sendNotification(method: string): Promise<void>;
    sendNotification(method: string, params: any): Promise<void>;
    onNotification<RO>(type: ProtocolNotificationType0<RO>, handler: NotificationHandler0): Disposable;
    onNotification<P, RO>(type: ProtocolNotificationType<P, RO>, handler: NotificationHandler<P>): Disposable;
    onNotification(type: NotificationType0, handler: () => void): Disposable;
    onNotification<P>(type: NotificationType<P>, handler: (params: P) => void): Disposable;
    onNotification(method: string, handler: (...params: any[]) => void): Disposable;
    onProgress<P>(type: ProgressType<any>, token: string | number, handler: (params: P) => void): Disposable;
    sendProgress<P>(type: ProgressType<P>, token: string | number, value: P): Promise<void>;
    debug(message: string, data?: any, showNotification?: boolean): void;
    info(message: string, data?: any, showNotification?: boolean): void;
    warn(message: string, data?: any, showNotification?: boolean): void;
    error(message: string, data?: any, showNotification?: boolean | 'force'): void;
    traceMessage(message: string, data?: any): void;
    readonly state: State;
    readonly middleware: Middleware;
    readonly initializeResult: InitializeResult | undefined;
    readonly clientOptions: LanguageClientOptions;
    readonly outputChannel: OutputChannel;
    readonly onDidChangeState: Event<StateChangeEvent>;
    readonly diagnostics: DiagnosticCollection | undefined;
    readonly serviceState: ClientState;
    readonly started: boolean;
    readonly isInDebugMode: boolean;
    needsStart(): boolean;
    needsStop(): boolean;
    onReady(): Promise<void>;
    set trace(value: Trace);
    isRunning(): boolean;
    stop(): Promise<void>;
    start(): Promise<void>;
    restart(): Promise<void>;
    dispose(): Promise<void>;
    registerFeature(feature: StaticFeature | DynamicFeature<any>): void;
    handleFailedRequest<T, P extends {
        method: string;
    }>(type: P, token: CancellationToken | undefined, error: any, defaultValue: T, showNotification?: boolean): T;
    createDefaultErrorHandler(maxRestartCount?: number): ErrorHandler;
    getFeature(request: 'workspace/executeCommand'): DynamicFeature<GeneralRegistrationOptions>;
    getFeature(request: 'workspace/didChangeWorkspaceFolders'): DynamicFeature<void>;
    getFeature(request: 'workspace/didChangeWatchedFiles'): DynamicFeature<DidChangeWatchedFilesRegistrationOptions>;
    getFeature(request: 'workspace/didChangeConfiguration'): DynamicFeature<DidChangeConfigurationRegistrationOptions>;
    getFeature(request: 'textDocument/didOpen'): DidOpenTextDocumentFeatureShape;
    getFeature(request: 'textDocument/didChange'): DidChangeTextDocumentFeatureShape;
    getFeature(request: 'textDocument/willSave'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentSendFeature<(textDocument: TextDocumentWillSaveEvent) => Promise<void>>;
    getFeature(request: 'textDocument/willSaveWaitUntil'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentSendFeature<(textDocument: TextDocument) => ProviderResult<TextEdit[]>>;
    getFeature(request: 'textDocument/didSave'): DidSaveTextDocumentFeatureShape;
    getFeature(request: 'textDocument/didClose'): DidCloseTextDocumentFeatureShape;
    getFeature(request: 'workspace/didCreateFiles'): DynamicFeature<GeneralRegistrationOptions> & {
        send: (event: FileCreateEvent) => Promise<void>;
    };
    getFeature(request: 'workspace/didRenameFiles'): DynamicFeature<GeneralRegistrationOptions> & {
        send: (event: FileRenameEvent) => Promise<void>;
    };
    getFeature(request: 'workspace/didDeleteFiles'): DynamicFeature<GeneralRegistrationOptions> & {
        send: (event: FileDeleteEvent) => Promise<void>;
    };
    getFeature(request: 'workspace/willCreateFiles'): DynamicFeature<GeneralRegistrationOptions> & {
        send: (event: FileWillCreateEvent) => Promise<void>;
    };
    getFeature(request: 'workspace/willRenameFiles'): DynamicFeature<GeneralRegistrationOptions> & {
        send: (event: FileWillRenameEvent) => Promise<void>;
    };
    getFeature(request: 'workspace/willDeleteFiles'): DynamicFeature<GeneralRegistrationOptions> & {
        send: (event: FileWillDeleteEvent) => Promise<void>;
    };
    getFeature(request: 'workspace/symbol'): DynamicFeature<TextDocumentRegistrationOptions> & WorkspaceProviderFeature<WorkspaceSymbolProvider>;
    getFeature(request: 'textDocument/completion'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<CompletionItemProvider>;
    getFeature(request: 'textDocument/hover'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<HoverProvider>;
    getFeature(request: 'textDocument/signatureHelp'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<SignatureHelpProvider>;
    getFeature(request: 'textDocument/definition'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<DefinitionProvider>;
    getFeature(request: 'textDocument/references'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<ReferenceProvider>;
    getFeature(request: 'textDocument/documentHighlight'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<DocumentHighlightProvider>;
    getFeature(request: 'textDocument/codeAction'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<CodeActionProvider>;
    getFeature(request: 'textDocument/codeLens'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<CodeLensProviderShape>;
    getFeature(request: 'textDocument/formatting'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<DocumentFormattingEditProvider>;
    getFeature(request: 'textDocument/rangeFormatting'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<DocumentRangeFormattingEditProvider>;
    getFeature(request: 'textDocument/onTypeFormatting'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<OnTypeFormattingEditProvider>;
    getFeature(request: 'textDocument/rename'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<RenameProvider>;
    getFeature(request: 'textDocument/documentSymbol'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<DocumentSymbolProvider>;
    getFeature(request: 'textDocument/documentLink'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<DocumentLinkProvider>;
    getFeature(request: 'textDocument/documentColor'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<DocumentColorProvider>;
    getFeature(request: 'textDocument/declaration'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<DeclarationProvider>;
    getFeature(request: 'textDocument/foldingRange'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<FoldingRangeProviderShape>;
    getFeature(request: 'textDocument/implementation'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<ImplementationProvider>;
    getFeature(request: 'textDocument/selectionRange'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<SelectionRangeProvider>;
    getFeature(request: 'textDocument/typeDefinition'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<TypeDefinitionProvider>;
    getFeature(request: 'textDocument/prepareCallHierarchy'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<CallHierarchyProvider>;
    getFeature(request: 'textDocument/semanticTokens'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<SemanticTokensProviderShape>;
    getFeature(request: 'textDocument/linkedEditingRange'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<LinkedEditingRangeProvider>;
    getFeature(request: 'textDocument/prepareTypeHierarchy'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<TypeHierarchyProvider>;
    getFeature(request: 'textDocument/inlineValue'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<InlineValueProviderShape>;
    getFeature(request: 'textDocument/inlayHint'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<InlayHintsProviderShape>;
    getFeature(request: 'textDocument/diagnostic'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<DiagnosticProviderShape> & DiagnosticFeatureShape;
    getFeature(request: 'workspace/textDocumentContent'): DynamicFeature<TextDocumentRegistrationOptions> & WorkspaceProviderFeature<TextDocumentContentProviderShape>;
    getFeature(request: 'textDocument/inlineCompletion'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<InlineCompletionItemProvider>;
}

Members

readonly id: string;

Id of the language client.

readonly name: string;

Name of the language client.

constructor(id: string, name: string, serverOptions: ServerOptions, clientOptions: LanguageClientOptions, forceDebug?: boolean);
constructor(name: string, serverOptions: ServerOptions, clientOptions: LanguageClientOptions, forceDebug?: boolean);

Create language client by name and options, don't forget to register language client to services by services.registerLanguageClient

sendRequest<R, PR, E, RO>(type: ProtocolRequestType0<R, PR, E, RO> | RequestProtocolSignature0<R, PR, E, RO>, token?: CancellationToken): Promise<R>;

Send a request to the language server.

sendRequest<P, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO> | RequestProtocolSignature<P, R, PR, E, RO>, params: P, token?: CancellationToken): Promise<R>;

Send a request to the language server.

sendRequest<R, E>(type: RequestType0<R, E> | RequestSignature0<R, E>, token?: CancellationToken): Promise<R>;

Send a request to the language server.

sendRequest<P, R, E>(type: RequestType<P, R, E> | RequestSignature<P, R, E>, params: P, token?: CancellationToken): Promise<R>;

Send a request to the language server.

sendRequest<R>(method: string, token?: CancellationToken): Promise<R>;

Send a request to the language server by method name.

sendRequest<R>(method: string, param: any, token?: CancellationToken): Promise<R>;

Send a request to the language server by method name with parameters.

onRequest<R, PR, E, RO>(type: ProtocolRequestType0<R, PR, E, RO>, handler: RequestHandler0<R, E>): Disposable;

Register a request handler for requests from the language server.

onRequest<P, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO>, handler: RequestHandler<P, R, E>): Disposable;

Register a request handler for requests from the language server.

onRequest<R, E>(type: RequestType0<R, E>, handler: RequestHandler0<R, E>): Disposable;

Register a request handler for requests from the language server.

onRequest<P, R, E>(type: RequestType<P, R, E>, handler: RequestHandler<P, R, E>): Disposable;

Register a request handler for requests from the language server.

onRequest<R, E>(method: string, handler: (...params: any[]) => HandlerResult<R, E>): Disposable;

Register a request handler by method name.

sendNotification<RO>(type: ProtocolNotificationType0<RO> | NotificationProtocolSignature0<RO>): Promise<void>;

Send a notification to the language server.

sendNotification<P, RO>(type: ProtocolNotificationType<P, RO> | NotificationSignature<P>, params?: P): Promise<void>;

Send a notification to the language server.

sendNotification(type: NotificationType0 | NotificationSignature0): Promise<void>;

Send a notification to the language server.

sendNotification<P>(type: NotificationType<P> | NotificationSignature<P>, params?: P): Promise<void>;

Send a notification to the language server.

sendNotification(method: string): Promise<void>;

Send a notification to the language server by method name.

sendNotification(method: string, params: any): Promise<void>;

Send a notification to the language server by method name with parameters.

onNotification<RO>(type: ProtocolNotificationType0<RO>, handler: NotificationHandler0): Disposable;

Register a notification handler for notifications from the language server.

onNotification<P, RO>(type: ProtocolNotificationType<P, RO>, handler: NotificationHandler<P>): Disposable;

Register a notification handler for notifications from the language server.

onNotification(type: NotificationType0, handler: () => void): Disposable;

Register a notification handler for notifications from the language server.

onNotification<P>(type: NotificationType<P>, handler: (params: P) => void): Disposable;

Register a notification handler for notifications from the language server.

onNotification(method: string, handler: (...params: any[]) => void): Disposable;

Register a notification handler by method name.

onProgress<P>(type: ProgressType<any>, token: string | number, handler: (params: P) => void): Disposable;

Register a progress handler for progress reports from the language server.

sendProgress<P>(type: ProgressType<P>, token: string | number, value: P): Promise<void>;

Send a progress report to the language server.

debug(message: string, data?: any, showNotification?: boolean): void;

Append debug message to outputChannel

info(message: string, data?: any, showNotification?: boolean): void;

Append info message to outputChannel

warn(message: string, data?: any, showNotification?: boolean): void;

Append warning message to outputChannel

error(message: string, data?: any, showNotification?: boolean | 'force'): void;

Append error message to outputChannel

traceMessage(message: string, data?: any): void;

Append trace message to traceOutputChannel or outputChannel

readonly state: State;

Current state of the language client.

readonly middleware: Middleware;

Middleware of the language client.

readonly initializeResult: InitializeResult | undefined;

Result of the initialize request.

readonly clientOptions: LanguageClientOptions;

Options of the language client.

readonly outputChannel: OutputChannel;

Output channel of the language client.

readonly onDidChangeState: Event<StateChangeEvent>;

Fired on language server state change.

readonly diagnostics: DiagnosticCollection | undefined;

Diagnostic collection of the language client.

readonly serviceState: ClientState;

Current running state.

readonly started: boolean;

Whether the language client has been started.

readonly isInDebugMode: boolean;

The server is running in debug mode by forceDebug or debug arguments of NodeJS.

needsStart(): boolean;

Check if server could start.

needsStop(): boolean;

Check if server could stop.

onReady(): Promise<void>;

Resolved when server ready

set trace(value: Trace);

Set the trace level of the language client.

isRunning(): boolean;

Return true when the client is running.

stop(): Promise<void>;

Stop language server.

start(): Promise<void>;

Start language server, not needed when registered to services by services.registerLanguageClient

restart(): Promise<void>;

Restart language client.

dispose(): Promise<void>;

Dispose the language client.

registerFeature(feature: StaticFeature | DynamicFeature<any>): void;

Register custom feature.

handleFailedRequest<T, P extends { method: string; }>(type: P, token: CancellationToken | undefined, error: any, defaultValue: T, showNotification?: boolean): T;

Log failed request to outputChannel and throw error when necessary.

createDefaultErrorHandler(maxRestartCount?: number): ErrorHandler;

Create a default error handler.

getFeature(request: 'workspace/executeCommand'): DynamicFeature<GeneralRegistrationOptions>;

Get the feature handling workspace/executeCommand, with registration for general registration options.

getFeature(request: 'workspace/didChangeWorkspaceFolders'): DynamicFeature<void>;

Get the feature handling workspace/didChangeWorkspaceFolders.

getFeature(request: 'workspace/didChangeWatchedFiles'): DynamicFeature<DidChangeWatchedFilesRegistrationOptions>;

Get the feature handling workspace/didChangeWatchedFiles, with registration for watched files.

getFeature(request: 'workspace/didChangeConfiguration'): DynamicFeature<DidChangeConfigurationRegistrationOptions>;

Get the feature handling workspace/didChangeConfiguration, with registration for configuration sections.

getFeature(request: 'textDocument/didOpen'): DidOpenTextDocumentFeatureShape;

Get the feature handling textDocument/didOpen, sending open notifications for text documents.

getFeature(request: 'textDocument/didChange'): DidChangeTextDocumentFeatureShape;

Get the feature handling textDocument/didChange, sending change notifications for text documents.

getFeature(request: 'textDocument/willSave'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentSendFeature<(textDocument: TextDocumentWillSaveEvent) => Promise<void>>;

Get the feature handling textDocument/willSave, sending will-save notifications.

getFeature(request: 'textDocument/willSaveWaitUntil'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentSendFeature<(textDocument: TextDocument) => ProviderResult<TextEdit[]>>;

Get the feature handling textDocument/willSaveWaitUntil, sending will-save-wait-until requests that return edits.

getFeature(request: 'textDocument/didSave'): DidSaveTextDocumentFeatureShape;

Get the feature handling textDocument/didSave, sending save notifications.

getFeature(request: 'textDocument/didClose'): DidCloseTextDocumentFeatureShape;

Get the feature handling textDocument/didClose, sending close notifications.

getFeature(request: 'workspace/didCreateFiles'): DynamicFeature<GeneralRegistrationOptions> & { send: (event: FileCreateEvent) => Promise<void>; };

Get the feature handling workspace/didCreateFiles, sending file create events.

getFeature(request: 'workspace/didRenameFiles'): DynamicFeature<GeneralRegistrationOptions> & { send: (event: FileRenameEvent) => Promise<void>; };

Get the feature handling workspace/didRenameFiles, sending file rename events.

getFeature(request: 'workspace/didDeleteFiles'): DynamicFeature<GeneralRegistrationOptions> & { send: (event: FileDeleteEvent) => Promise<void>; };

Get the feature handling workspace/didDeleteFiles, sending file delete events.

getFeature(request: 'workspace/willCreateFiles'): DynamicFeature<GeneralRegistrationOptions> & { send: (event: FileWillCreateEvent) => Promise<void>; };

Get the feature handling workspace/willCreateFiles, sending file will-create events.

getFeature(request: 'workspace/willRenameFiles'): DynamicFeature<GeneralRegistrationOptions> & { send: (event: FileWillRenameEvent) => Promise<void>; };

Get the feature handling workspace/willRenameFiles, sending file will-rename events.

getFeature(request: 'workspace/willDeleteFiles'): DynamicFeature<GeneralRegistrationOptions> & { send: (event: FileWillDeleteEvent) => Promise<void>; };

Get the feature handling workspace/willDeleteFiles, sending file will-delete events.

getFeature(request: 'workspace/symbol'): DynamicFeature<TextDocumentRegistrationOptions> & WorkspaceProviderFeature<WorkspaceSymbolProvider>;

Get the feature handling workspace/symbol, providing workspace symbol providers.

getFeature(request: 'textDocument/completion'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<CompletionItemProvider>;

Get the feature handling textDocument/completion, providing completion item providers.

getFeature(request: 'textDocument/hover'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<HoverProvider>;

Get the feature handling textDocument/hover, providing hover providers.

getFeature(request: 'textDocument/signatureHelp'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<SignatureHelpProvider>;

Get the feature handling textDocument/signatureHelp, providing signature help providers.

getFeature(request: 'textDocument/definition'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<DefinitionProvider>;

Get the feature handling textDocument/definition, providing definition providers.

getFeature(request: 'textDocument/references'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<ReferenceProvider>;

Get the feature handling textDocument/references, providing reference providers.

getFeature(request: 'textDocument/documentHighlight'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<DocumentHighlightProvider>;

Get the feature handling textDocument/documentHighlight, providing document highlight providers.

getFeature(request: 'textDocument/codeAction'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<CodeActionProvider>;

Get the feature handling textDocument/codeAction, providing code action providers.

getFeature(request: 'textDocument/codeLens'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<CodeLensProviderShape>;

Get the feature handling textDocument/codeLens, providing code lens providers.

getFeature(request: 'textDocument/formatting'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<DocumentFormattingEditProvider>;

Get the feature handling textDocument/formatting, providing document formatting edit providers.

getFeature(request: 'textDocument/rangeFormatting'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<DocumentRangeFormattingEditProvider>;

Get the feature handling textDocument/rangeFormatting, providing range formatting edit providers.

getFeature(request: 'textDocument/onTypeFormatting'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<OnTypeFormattingEditProvider>;

Get the feature handling textDocument/onTypeFormatting, providing on-type formatting edit providers.

getFeature(request: 'textDocument/rename'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<RenameProvider>;

Get the feature handling textDocument/rename, providing rename providers.

getFeature(request: 'textDocument/documentSymbol'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<DocumentSymbolProvider>;

Get the feature handling textDocument/documentSymbol, providing document symbol providers.

getFeature(request: 'textDocument/documentLink'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<DocumentLinkProvider>;

Get the feature handling textDocument/documentLink, providing document link providers.

getFeature(request: 'textDocument/documentColor'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<DocumentColorProvider>;

Get the feature handling textDocument/documentColor, providing document color providers.

getFeature(request: 'textDocument/declaration'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<DeclarationProvider>;

Get the feature handling textDocument/declaration, providing declaration providers.

getFeature(request: 'textDocument/foldingRange'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<FoldingRangeProviderShape>;

Get the feature handling textDocument/foldingRange, providing folding range providers.

getFeature(request: 'textDocument/implementation'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<ImplementationProvider>;

Get the feature handling textDocument/implementation, providing implementation providers.

getFeature(request: 'textDocument/selectionRange'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<SelectionRangeProvider>;

Get the feature handling textDocument/selectionRange, providing selection range providers.

getFeature(request: 'textDocument/typeDefinition'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<TypeDefinitionProvider>;

Get the feature handling textDocument/typeDefinition, providing type definition providers.

getFeature(request: 'textDocument/prepareCallHierarchy'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<CallHierarchyProvider>;

Get the feature handling textDocument/prepareCallHierarchy, providing call hierarchy providers.

getFeature(request: 'textDocument/semanticTokens'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<SemanticTokensProviderShape>;

Get the feature handling textDocument/semanticTokens, providing semantic tokens providers.

getFeature(request: 'textDocument/linkedEditingRange'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<LinkedEditingRangeProvider>;

Get the feature handling textDocument/linkedEditingRange, providing linked editing range providers.

getFeature(request: 'textDocument/prepareTypeHierarchy'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<TypeHierarchyProvider>;

Get the feature handling textDocument/prepareTypeHierarchy, providing type hierarchy providers.

getFeature(request: 'textDocument/inlineValue'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<InlineValueProviderShape>;

Get the feature handling textDocument/inlineValue, providing inline value providers.

getFeature(request: 'textDocument/inlayHint'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<InlayHintsProviderShape>;

Get the feature handling textDocument/inlayHint, providing inlay hint providers.

getFeature(request: 'textDocument/diagnostic'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<DiagnosticProviderShape> & DiagnosticFeatureShape;

Get the feature handling textDocument/diagnostic, providing diagnostic providers with refresh support.

getFeature(request: 'workspace/textDocumentContent'): DynamicFeature<TextDocumentRegistrationOptions> & WorkspaceProviderFeature<TextDocumentContentProviderShape>;

Get the feature handling workspace/textDocumentContent, providing text document content providers.

getFeature(request: 'textDocument/inlineCompletion'): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<InlineCompletionItemProvider>;

Get the feature handling textDocument/inlineCompletion, providing inline completion item providers.

Kind
class
Declaration
typings/index.d.ts:15317
types

SettingMonitor

Monitor for setting change, restart language server when specified setting changed.

Source

Class definition

export class SettingMonitor {
    constructor(client: LanguageClient, setting: string);
    start(): Disposable;
}

Members

constructor(client: LanguageClient, setting: string);
start(): Disposable;

Start monitoring the setting and start the client when it is enabled.

Kind
class
Declaration
typings/index.d.ts:15743