このコンテンツはまだ日本語訳がありません。
LspServer
Language Server Protocol (LSP) interface for Sandbox code intelligence operations.
This class wraps Toolbox LspApi operations and maps Toolbox API errors to Daytona SDK
exceptions via ExceptionMapper. It supports starting/stopping language servers,
notifying document open/close events, and retrieving completions and symbols.
Constructors
new LspServer()
public LspServer(LspApi lspApi)Creates an LSP server wrapper using the Toolbox LSP API client.
Parameters:
lspApiLspApi - Toolbox LSP API client
Methods
start()
public void start(String languageId, String pathToProject)Starts a language server for the specified language and project root.
This must be called before document notifications or code intelligence requests.
Parameters:
languageIdString - language identifier (for example"python","typescript")pathToProjectString - absolute or relative project root path inside the sandbox
stop()
public void stop(String languageId, String pathToProject)Stops a language server for the specified language and project root.
Parameters:
languageIdString - language identifierpathToProjectString - absolute or relative project root path inside the sandbox
didOpen()
public void didOpen(String languageId, String pathToProject, String uri)Notifies the language server that a document has been opened.
Use this before requesting completions or symbols for a document to ensure the language server tracks it.
Parameters:
languageIdString - language identifierpathToProjectString - absolute or relative project root path inside the sandboxuriString - document URI (typicallyfile://...)
didClose()
public void didClose(String languageId, String pathToProject, String uri)Notifies the language server that a document has been closed.
Parameters:
languageIdString - language identifierpathToProjectString - absolute or relative project root path inside the sandboxuriString - document URI (typicallyfile://...)
completions()
public CompletionList completions(String languageId, String pathToProject, String uri, int line, int character)Retrieves completion candidates at a zero-based position in a document.
Parameters:
languageIdString - language identifierpathToProjectString - absolute or relative project root path inside the sandboxuriString - document URI (typicallyfile://...)lineint - zero-based line numbercharacterint - zero-based character offset on the line
Returns:
CompletionList- completion list returned by the language server
documentSymbols()
public List<LspSymbol> documentSymbols(String languageId, String pathToProject, String uri)Returns all symbols defined in the specified document.
Parameters:
languageIdString - language identifierpathToProjectString - absolute or relative project root path inside the sandboxuriString - document URI (typicallyfile://...)
Returns:
List\<LspSymbol\>- list of document symbols
workspaceSymbols()
public List<LspSymbol> workspaceSymbols(String query, String languageId, String pathToProject)Searches workspace-wide symbols matching the provided query.
Parameters:
queryString - symbol query textlanguageIdString - language identifierpathToProjectString - absolute or relative project root path inside the sandbox
Returns:
List\<LspSymbol\>- list of matching workspace symbols