Skip to content
View as Markdown
new LspServer(
transport: HttpTransport,
languageId: string,
pathToProject: string): LspServer;

Parameters:

  • transport HttpTransport
  • languageId string
  • pathToProject string

Returns:

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

Returns:

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

Parameters:

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

Returns:

  • Promise<LspCompletionList>
didClose(uri: string): Promise<void>;

Parameters:

  • uri string

Returns:

  • Promise<void>
didOpen(uri: string): Promise<void>;

Parameters:

  • uri string

Returns:

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

Parameters:

  • uri string

Returns:

  • Promise<LspSymbol[]>
stop(): Promise<void>;

Returns:

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

Parameters:

  • query string

Returns:

  • Promise<LspSymbol[]>

Sandbox LSP namespace.

Every call is scoped by languageId + pathToProject: the daemon keys one language server per pair, starting it on demand and reusing it afterwards. start() is therefore about controlling WHEN the server boots (and surfacing LSP_SERVER_UNAVAILABLE when the image lacks it), not a precondition the other calls can skip — they answer LSP_NOT_STARTED rather than starting one implicitly.

new LspService(transport: HttpTransport): LspService;

Parameters:

  • transport HttpTransport

Returns:

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

Start the language server for a project.

Parameters:

  • languageId string
  • pathToProject string

Returns:

  • Promise<LspServer>

Properties:

  • context? toolbox.CompletionRequest[‘context’]

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

One completion candidate. Shape follows the language server, so the daemon passes items through with only isIncomplete/items normalized.


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

type LspLocation = toolbox.SymbolLocation

type LspPosition = toolbox.SymbolPosition

A zero-based LSP position.


type LspRange = toolbox.SymbolRange

type LspSymbol = toolbox.SymbolInfo

One symbol from documentSymbols() / workspaceSymbols().