apps/docs/src/content/docs/en/ruby-sdk/lsp-server.mdx
LspServer class for Daytona SDK.
def initialize(language_id:, path_to_project:, toolbox_api:, sandbox_id:, otel_state:)
Parameters:
language_id Symbol -path_to_project String -toolbox_api DaytonaToolboxApiClient:LspApi -sandbox_id String -otel_state Daytona:OtelState, nil -Returns:
LspServer - a new instance of LspServerdef language_id()
Returns:
Symboldef path_to_project()
Returns:
Stringdef toolbox_api()
Returns:
DaytonaToolboxApiClient:LspApidef sandbox_id()
Returns:
Stringdef completions(path:, position:)
Gets completion suggestions at a position in a file
Parameters:
path String -position Daytona:LspServer:Position -Returns:
DaytonaApiClient:CompletionListdef did_close(path)
Notify the language server that a file has been closed. This method should be called when a file is closed in the editor to allow the language server to clean up any resources associated with that file.
Parameters:
path String -Returns:
voiddef did_open(path)
Notifies the language server that a file has been opened. This method should be called when a file is opened in the editor to enable language features like diagnostics and completions for that file. The server will begin tracking the file's contents and providing language features.
Parameters:
path String -Returns:
voiddef document_symbols(path)
Gets symbol information (functions, classes, variables, etc.) from a document.
Parameters:
path String -Returns:
Array\<DaytonaToolboxApiClient:LspSymbol]def sandbox_symbols(query)
Searches for symbols matching the query string across all files in the Sandbox.
Parameters:
query String -Returns:
Array\<DaytonaToolboxApiClient:LspSymbol]def start()
Starts the language server. This method must be called before using any other LSP functionality. It initializes the language server for the specified language and project.
Returns:
voiddef stop()
Stops the language server. This method should be called when the LSP server is no longer needed to free up system resources.
Returns:
void