Sign Up

LspServer

Constructors

Constructor

new LspServer(
   transport: HttpTransport,
   languageId: string,
   pathToProject: string): LspServer;

Parameters:

  • transport HttpTransport
  • languageId string
  • pathToProject string

Returns:

  • LspServer

Methods

[Symbol.asyncDispose]()

[Symbol.asyncDispose](): Promise<void>;

Returns:

  • Promise<void>

closeDocument()

closeDocument(uri: string): Promise<void>;

Notify the server that the document at uri was closed.

Parameters:

  • uri string

Returns:

  • Promise<void>

completions()

completions(
   uri: string,
   position: LspPosition,
   options: LspCompletionsOptions = {}): Promise<LspCompletionList>;

Parameters:

  • uri string
  • position LspPosition
  • options LspCompletionsOptions = {}

Returns:

  • Promise<LspCompletionList>

documentSymbols()

documentSymbols(uri: string): Promise<LspSymbol[]>;

Parameters:

  • uri string

Returns:

  • Promise<LspSymbol[]>

openDocument()

openDocument(uri: string): Promise<void>;

Notify the server that the document at uri was opened.

Parameters:

  • uri string

Returns:

  • Promise<void>

stop()

stop(): Promise<void>;

Returns:

  • Promise<void>

workspaceSymbols()

workspaceSymbols(query: string): Promise<LspSymbol[]>;

Parameters:

  • query string

Returns:

  • Promise<LspSymbol[]>

LspService

Sandbox LSP namespace.

Each language server is identified by languageId + pathToProject. Call start() before other operations: an unavailable language server raises LSP_SERVER_UNAVAILABLE, and operations on a server that has not started raise LSP_NOT_STARTED.

Constructors

Constructor

new LspService(transport: HttpTransport): LspService;

Parameters:

  • transport HttpTransport

Returns:

  • LspService

Methods

start()

start(languageId: string, pathToProject: string): Promise<LspServer>;

Start the language server for a project.

Parameters:

  • languageId string
  • pathToProject string

Returns:

  • Promise<LspServer>

LspCompletionsOptions

Properties:

  • context? toolbox.CompletionRequest['context']

LspCompletionItem

type LspCompletionItem = {
  [key: string]: unknown
} & Omit<toolbox.CompletionItem, 'documentation'> & {
  documentation?: unknown
}

One completion candidate, with the shape supplied by the language server.


LspCompletionList

type LspCompletionList = Omit<toolbox.CompletionList, 'items'> & { items: LspCompletionItem[] }

LspLocation

type LspLocation = toolbox.SymbolLocation

LspPosition

type LspPosition = toolbox.SymbolPosition

A zero-based LSP position.


LspRange

type LspRange = toolbox.SymbolRange

LspSymbol

type LspSymbol = toolbox.SymbolInfo

One symbol from documentSymbols() / workspaceSymbols().