Skip to main content
The LSP API provides endpoints for integrating Language Server Protocol (LSP) servers, enabling advanced code intelligence features like code completion, symbol navigation, and workspace symbol search.

What is LSP?

The Language Server Protocol (LSP) provides language intelligence features such as:
  • Code Completion - Context-aware suggestions while typing
  • Document Symbols - Navigate functions, classes, and variables
  • Workspace Symbols - Search symbols across entire project
  • Diagnostics - Real-time error and warning detection
The Toolbox LSP API manages LSP server lifecycle and provides access to these features.

LSP Server Management

Start LSP Server

Start a Language Server for a specific programming language.
Request Body:
Parameters: Supported Languages:
  • typescript / javascript
  • python
  • go
  • rust
  • java
  • And others depending on server availability

Stop LSP Server

Stop a running Language Server.
Request Body:

Document Lifecycle

Open Document

Notify the LSP server that a document has been opened.
Request Body:
Parameters:

Close Document

Notify the LSP server that a document has been closed.
Request Body:

Code Intelligence

Get Code Completions

Get code completion suggestions at a specific position.
Request Body:
Position Object: Context Object: Response:
Completion Item Kinds:
  • 1 - Text
  • 2 - Method
  • 3 - Function
  • 4 - Constructor
  • 5 - Field
  • 6 - Variable
  • 7 - Class
  • 8 - Interface
  • And more…

Get Document Symbols

Retrieve all symbols (functions, classes, variables) in a document.
Query Parameters: Response:
Symbol Kinds:
  • 1 - File
  • 2 - Module
  • 5 - Class
  • 6 - Method
  • 12 - Function
  • 13 - Variable
  • And more…

Search Workspace Symbols

Search for symbols across the entire workspace.
Query Parameters: Response:

Data Structures

Position

Represents a position in a document.

Range

Represents a range in a document.

Location

Represents a location in a document.

Best Practices

Start the LSP server once per project and reuse it for multiple document operations.
  • Always call did-open before requesting completions for a document
  • Call did-close when done with a document to free resources
  • Use workspace symbols for cross-file navigation
  • Handle incomplete completion lists by requesting more items
  • Stop LSP servers when no longer needed to conserve resources

Example Workflow

Prefer using the official Daytona SDKs over direct API calls for better type safety and LSP feature support.