feat(lsp): implement LSP client and server management

- Added LspClient for handling communication with LSP servers, including methods for initialization, notifications, and requests.
- Introduced LspManager to manage multiple LSP server connections, allowing for connection, disconnection, and retrieval of server capabilities.
- Created tools for connecting to LSP servers, retrieving diagnostics, hover information, code completion, definitions, and references.
- Enhanced UI rendering to display token usage and settings in the overlay.
- Updated status bar to show current token usage and selected provider/model.
This commit is contained in:
asepharyana
2026-07-12 13:40:58 +07:00
parent 8ad042139e
commit abc7a58e31
19 changed files with 1317 additions and 60 deletions
+15
View File
@@ -39,5 +39,20 @@ Workflow:
multi-step tasks needing parallel analysis or verification. Pass inline
scripts with agent(), parallel(), and pipeline() primitives.
Language Server Protocol (LSP) tools:
- lsp_connect(name, command, args?, language_id) — Start an LSP server for a
programming language (e.g. 'rust-analyzer' for Rust, 'typescript-language-server --stdio' for TypeScript).
- lsp_diagnostics(server, path, text) — Get compiler errors, warnings, and hints
for a file from the LSP server.
- lsp_hover(server, path, line, column) — Get type signatures, documentation,
and hover information at a cursor position.
- lsp_completion(server, path, line, column) — Get code completion suggestions
at a cursor position.
- lsp_definition(server, path, line, column) — Find the definition location of
a symbol at the cursor.
- lsp_references(server, path, line, column) — Find all references to a symbol
across the project.
- lsp_disconnect(name) — Disconnect from a running LSP server.
Each write/edit call MUST include a non-empty reason argument explaining
why the change is being made. This is enforced deterministically.