Skip to content

Developer Manual Misc Messages

Martin Lippert edited this page Jan 10, 2021 · 1 revision

sts/progress notification

Notifies client to show operation progress.

interface ProgressParams {
 id: string; // Task id
 statusMsg: string; // Progress status message to show in the UI
}

The server sends sts/progress messages to the client to provide information as various background tasks are progressing on the server.

The task id represents and uniquely identifies a continuing operation that is (or was) running on the server.

Typically, when a long running operation is started the server should generate a unique id. Then it can use this id to report progress for that operation. Sending a new progress message for the same task-id implicitly cancels/replaces any previously sent message for the same id. Sending a null value for the message indicates that the task is terminated (and implicitly cancels any prior progress messages for the same id).

Multpiple long running operations can be executing at the same time. Therefore, the client must be able to cope gracefully with having multiple simultaneously 'active' task id.

sts/moveCursor notification

Notifies client to moves the cursor position in the document.

interface ProgressParams {
 uri: string; // Document URI
 position: Position; // New cursor position in the document (LSP Position)
}

sts/highlights notification

Sends the data about CodeLenses to show in opened editors for documents. LSP has a CodeLens request message: textDocument/codeLens. The difference is that LSP's message is a request while in STS4 protocol extension it is a notification which may result for example from a 3rd party process data, e.g. number of method invocations at runtime.

interface HighlightParams {
 doc: VersionedTextDocumentIdentifier; // document id (VersionedTextDocumentIdentifier type is defined in LSP)
 codeLenses: CodeLens[]; // CodeLenses for the document (CodeLens type defined in LSP)
}
Clone this wiki locally