Skip to content

VS Code and LSP

The official Kelvra Developer Tools extension pairs language syntax and snippets with the kelvra-lsp server.

Install the extension from the Visual Studio Marketplace, or search for Kelvra Developer Tools in VS Code’s Extensions view.

Platform-specific packages for Linux x64, Apple Silicon macOS, and Windows x64 include a tested language server. The extension does not download executables at activation time and does not collect telemetry.

The shipped extension and language server provide:

  • syntax highlighting, snippets, bracket/comment behavior, and a .kel file icon
  • diagnostics, completion, and hover information
  • go to definition, references, rename, and workspace symbols
  • document formatting and semantic highlighting
  • import-aware navigation and package API documentation

For source declarations, a contiguous // comment group or /* ... */ comment immediately above a declaration appears when hovering its references. A blank line detaches the comment.

Package package.api.kel files also drive hover documentation from @doc(...), navigation to opaque package types, and readable imported signatures.

Normally, the bundled server starts automatically. For source checkouts and generic development VSIX files, discovery checks these locations in order:

  1. the explicit kelvra.serverPath setting
  2. the server bundled with the extension
  3. an installed Kelvra runtime selected with kelvra.runtimePath
  4. the active project’s build directory
  5. each workspace folder’s build directory
  6. kelvra-lsp on PATH

Relative settings resolve from the relevant workspace folder. An invalid explicit override is reported instead of being silently ignored.

Open the Command Palette and run:

  • Kelvra: Show Language Server Status to see the executable, working directory, server version, tooling protocol, and current state
  • Kelvra: Open Language Server Log to inspect every discovery candidate and rejection
  • Kelvra: Select Language Server to validate and save an executable override
  • Kelvra: Restart Language Server after rebuilding or changing configuration
  • Kelvra: Install Project Dependencies to run package installation with explicit consent and visible progress

If a relocated CMake build is selected, its cached source path may be invalid. Remove that dedicated build directory, configure it again from the current checkout, rebuild kelvra-lsp, and restart the server. Repeated server crashes are bounded and remain visible instead of causing an endless restart loop.

From the repository root:

Terminal window
npm --prefix tooling/vscode-kelvra ci
npm --prefix tooling/vscode-kelvra run compile
./build.sh

Use the repository’s Kelvra: Extension Development Host launch configuration. It opens an isolated development host with a development-only server path and does not alter personal VS Code settings.

Terminal window
npm --prefix tooling/vscode-kelvra run check
npm --prefix tooling/vscode-kelvra run test:extension