Table of Contents

Interface ILspServer

Namespace
NMF.AnyText
Assembly
NMF.AnyText.Lsp.dll

Denotes an interface for an LSP server

public interface ILspServer

Methods

CodeAction(JToken)

Handles the textDocument/codeAction request from the client.

[JsonRpcMethod("textDocument/codeAction")]
CodeAction[] CodeAction(JToken arg)

Parameters

arg JToken

The JSON token containing the parameters of the request. (CodeActionParams)

Returns

CodeAction[]

CodeLens(JToken)

Handles the textDocument/codeLens request from the client.

[JsonRpcMethod("textDocument/codeLens")]
CodeLens[] CodeLens(JToken arg)

Parameters

arg JToken

The JSON token containing the parameters of the request. (CodeLensParams)

Returns

CodeLens[]

A Array of CodeLens(JToken) objects containing the available CodeLenses of the document.

CodeLensResolve(JToken)

Handles the codeLense/resolve request from the client.

[JsonRpcMethod("codeLens/resolve")]
CodeLens CodeLensResolve(JToken arg)

Parameters

arg JToken

The JSON token containing the parameters of the request. (CodeLens)

Returns

CodeLens

A CodeLens(JToken) object containing the executed CodeLens

DidChange(JToken)

Gets called when the client signals a change

[JsonRpcMethod("textDocument/didChange")]
void DidChange(JToken arg)

Parameters

arg JToken

the parameters of the request

DidClose(JToken)

Gets called when the client closed a document

[JsonRpcMethod("textDocument/didClose")]
void DidClose(JToken arg)

Parameters

arg JToken

the parameters of the request

DidOpen(JToken)

Gets called when the client opened a document

[JsonRpcMethod("textDocument/didOpen")]
void DidOpen(JToken arg)

Parameters

arg JToken

the parameters of the request

DidSave(TextDocumentIdentifier, string)

Gets called when the client saved a document

[JsonRpcMethod("textDocument/didSave")]
void DidSave(TextDocumentIdentifier textDocument, string text)

Parameters

textDocument TextDocumentIdentifier

the document to save

text string

the actual text

ExecuteCommand(JToken)

Handles the workspace/ececuteCommand request from the client. This is used to execute an action on the Server.

[JsonRpcMethod("workspace/executeCommand")]
void ExecuteCommand(JToken arg)

Parameters

arg JToken

The JSON token containing the parameters of the request. (ExceuteCommandParams)

Exit()

Gets called when the client exits

[JsonRpcMethod("exit")]
void Exit()

Formatting(TextDocumentIdentifier, FormattingOptions)

Handles the textDocument/formatting request from the client.

[JsonRpcMethod("textDocument/formatting")]
TextEdit[] Formatting(TextDocumentIdentifier textDocument, FormattingOptions options)

Parameters

textDocument TextDocumentIdentifier

The identifier of the text document to be formatted.

options FormattingOptions

The formatting options provided by the client, such as indentation and spacing settings.

Returns

TextEdit[]

An array of TextEdit objects representing the formatting changes.

FormattingRange(TextDocumentIdentifier, Range, FormattingOptions)

Handles the textDocument/rangeFormatting request from the client.

[JsonRpcMethod("textDocument/rangeFormatting")]
TextEdit[] FormattingRange(TextDocumentIdentifier textDocument, Range range, FormattingOptions options)

Parameters

textDocument TextDocumentIdentifier

The identifier of the text document to be formatted.

range Range

The range within the document that should be formatted.

options FormattingOptions

The formatting options provided by the client, such as indentation and spacing settings.

Returns

TextEdit[]

An array of TextEdit objects representing the formatting changes within the specified range.

HandleCompletion(JToken)

Suggests completions

[JsonRpcMethod("textDocument/completion")]
CompletionList HandleCompletion(JToken arg)

Parameters

arg JToken

Returns

CompletionList

A completion list

Hover(JToken)

Handles the textDocument/hover request from the client.

[JsonRpcMethod("textDocument/hover")]
Hover Hover(JToken arg)

Parameters

arg JToken

The JSON token containing the parameters of the request. (TextDocumentHover)

Returns

Hover

Initialize(int?, _InitializeParams_ClientInfo, string, string, Uri, ClientCapabilities, TraceValue, WorkspaceFolder[], object)

Initializes the server

[JsonRpcMethod("initialize")]
InitializeResult Initialize(int? processId, _InitializeParams_ClientInfo clientInfo, string locale, string rootPath, Uri rootUri, ClientCapabilities capabilities, TraceValue trace, WorkspaceFolder[] workspaceFolders, object InitializationOptions = null)

Parameters

processId int?
clientInfo _InitializeParams_ClientInfo
locale string

the language

rootPath string
rootUri Uri
capabilities ClientCapabilities

capabilities of the client

trace TraceValue
workspaceFolders WorkspaceFolder[]

workspace folders

InitializationOptions object

options for the initialization

Returns

InitializeResult

Initialized()

Initializes the server

[JsonRpcMethod("initialized")]
void Initialized()

ProvideInlayHints(JToken)

Provides Inlay hints for the document

[JsonRpcMethod("textDocument/inlayHint")]
InlayHint[] ProvideInlayHints(JToken arg)

Parameters

arg JToken

The parameters of the request

Returns

InlayHint[]

A list of inlay hints

QueryDefinition(JToken)

Handles the textDocument/definition request from the client. This is used to retrieve the location of the definition of a symbol in a document.

[JsonRpcMethod("textDocument/definition")]
LocationLink QueryDefinition(JToken arg)

Parameters

arg JToken

The JSON token containing the parameters of the request. (TextDocumentPositionParams)

Returns

LocationLink

A LspTypes.LocationLink object containing the document and position of the definition of a symbol.

QueryDocumentHighlights(JToken)

Handles the textDocument/documentHighlight request from the client. This is used to retrieve the locations and kinds of all highlights for a literal at a given position in the document.

[JsonRpcMethod("textDocument/documentHighlight")]
DocumentHighlight[] QueryDocumentHighlights(JToken arg)

Parameters

arg JToken

The JSON token containing the parameters of the request. (DocumentHighlightParams)

Returns

DocumentHighlight[]

An array of LspTypes.DocumentHighlight objects containing the range and kind of all matching highlights in the document.

QueryDocumentSymbols(JToken)

Handles the textDocument/documentSymbol/full request from the client. This is used to retrieve all document symbols for a document, which can be used to show the outline of and jump to notable parts of the document.

[JsonRpcMethod("textDocument/documentSymbol")]
DocumentSymbol[] QueryDocumentSymbols(JToken arg)

Parameters

arg JToken

The JSON token containing the parameters of the request. (DocumentSymbolParams)

Returns

DocumentSymbol[]

An array of DocumentSymbol objects, each containing details on a document symbol with subsequent children symbols.

QueryFoldingRanges(JToken)

Handles the textDocument/foldingRange/full request from the client. This is used to retrieve all folding ranges for a document.

[JsonRpcMethod("textDocument/foldingRange")]
FoldingRange[] QueryFoldingRanges(JToken arg)

Parameters

arg JToken

The JSON token containing the parameters of the request. (FoldingRangeParams)

Returns

FoldingRange[]

An array of FoldingRange objects, each containing details on a folding range in the document.

QueryReferences(JToken)

Handles the textDocument/references request from the client. This is used to retrieve the locations of all references to a symbol in a document.

[JsonRpcMethod("textDocument/references")]
Location[] QueryReferences(JToken arg)

Parameters

arg JToken

The JSON token containing the parameters of the request. (ReferenceParams)

Returns

Location[]

An array of LspTypes.Location objects containing the documents and locations of the references to a symbol.

QueryRenameWorkspaceEdit(JToken)

Handles the textDocument/rename request from the client. This is used to determine the locations of a symbol in a workspace to perform a workspace-wide rename.

[JsonRpcMethod("textDocument/rename")]
WorkspaceEdit QueryRenameWorkspaceEdit(JToken arg)

Parameters

arg JToken

The JSON token containing the parameters of the request. (RenameParams)

Returns

WorkspaceEdit

A LspTypes.WorkspaceEdit object containing the changes to be performed by the client.

QuerySelectionRanges(JToken)

Handles the textDocument/selectionRange request from the client. This is used to retrieve selection ranges at an array of given positions in a document.

[JsonRpcMethod("textDocument/selectionRange")]
SelectionRange[] QuerySelectionRanges(JToken arg)

Parameters

arg JToken

The JSON token containing the parameters of the request. (SelectionRangeParams)

Returns

SelectionRange[]

An array of SelectionRange objects, each containing details on a selection range in the document corresponding to the received positions.

QuerySemanticTokens(JToken)

Handles the textDocument/semanticTokens/full request from the client. This is used to retrieve all semantic tokens for a document.

[JsonRpcMethod("textDocument/semanticTokens/full")]
SemanticTokens QuerySemanticTokens(JToken arg)

Parameters

arg JToken

The JSON token containing the parameters of the request. (SemanticTokensParams)

Returns

SemanticTokens

A LspTypes.SemanticTokens object containing the full set of semantic tokens for the document.

QuerySemanticTokensDelta(JToken)

Handles the textDocument/semanticTokens/full/delta request from the client. This is used to retrieve only the changes (delta) in semantic tokens for a document.

[JsonRpcMethod("textDocument/semanticTokens/full/delta")]
SemanticTokensDelta QuerySemanticTokensDelta(JToken arg)

Parameters

arg JToken

The JSON token containing the parameters of the request. (SemanticTokensDeltaParams)

Returns

SemanticTokensDelta

A LspTypes.SemanticTokensDelta object containing only the delta of semantic tokens for the document.

QuerySemanticTokensRange(JToken)

Handles the textDoocument/semanticTokens/range request from the client. This is used to retrieve semantic tokens within a specific range in the document.

[JsonRpcMethod("textDocument/semanticTokens/range")]
SemanticTokens QuerySemanticTokensRange(JToken arg)

Parameters

arg JToken

The JSON token containing the parameters of the range request. (SemanticTokensRangeParams)

Returns

SemanticTokens

A LspTypes.SemanticTokens object containing the semantic tokens within the specified range.

SetTrace(JToken)

Handles the $/setTrace request from the client. This is used to set the trace setting of the server.

[JsonRpcMethod("$/setTrace")]
void SetTrace(JToken arg)

Parameters

arg JToken

The JSON token containing the parameters of the request. (SetTraceParams)

Shutdown()

Shuts down the server

[JsonRpcMethod("shutdown")]
void Shutdown()