Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Language Server Protocol

Vix™ speaks the Language Server Protocol (LSP), so you get real, compiler-grade help — diagnostics, completion, hover, go-to-definition, rename, and more — from the same language servers other editors use. Install a server (e.g. rust-analyzer, pyright, gopls, typescript-language-server) and, once you trust the workspace, Vix finds it on your PATH and starts it the first time you open a matching file; the trust prompt names the server first, because a server can run the project’s build code. Add an lsp_servers entry to use a different server, or one Vix does not know.

The protocol core lives in the vix-lsp-core crate (JSON-RPC framing, request builders, response parsers, and char↔UTF-16/UTF-8 position maths); the process IO and editor wiring live in the vix-lsp crate. The authoritative method list is crates/vix-lsp/spec/language-server-protocol.tsv.

Configuration

Two settings (see configuration):

  • lsp_enabled — master on/off switch (on by default).
  • lsp_servers — a list mapping language ids / file extensions to a server command. Each entry names the command to spawn and the extensions it handles.

Servers start lazily when you open a matching file. Vix advertises UTF-16 and UTF-8 position encodings and adopts whatever the server selects.

What you get

Most actions live under Tools → Language Server and the command palette (>LSP …); a few have direct keys.

CapabilityHow to use itLSP method(s)
DiagnosticsErrors/warnings underline in color; Diagnostics… opens a workspace-wide list (Enter jumps). A server that waits to be asked is asked after each open and shortly after you stop typing.publishDiagnostics, textDocument/diagnostic, workspace/diagnostic
HoverType info / docs popup for the symbol under the cursor.hover
CompletionAuto-complete popup; detail/docs fill in as you scroll the list.completion, completionItem/resolve
Go to definitionF12 jumps to where a symbol is defined.definition
Implementation / type definitionJump to the implementation or the type’s definition.implementation, typeDefinition
Find referencesLists every use in the results panel (Enter jumps).references
Call hierarchyCallers or callees of the function under the cursor in the results panel; Alt+D there flips between them.prepareCallHierarchy, callHierarchy/incomingCalls, callHierarchy/outgoingCalls
Type hierarchySupertypes or subtypes of the type under the cursor; Alt+D flips between them.prepareTypeHierarchy, typeHierarchy/supertypes, typeHierarchy/subtypes
Highlight occurrencesMarks the other occurrences of the symbol under the cursor.documentHighlight
Document symbolsOutline of the current file; Enter jumps.documentSymbol
Workspace symbolsPrompt for a query, jump to a symbol anywhere in the project.workspace/symbol
Signature helpParameter hints popup.signatureHelp
FormatFormat the whole document, or the selection.formatting, rangeFormatting
RenameF2, then a new name — applied across every file via a workspace edit.rename
Code actionsQuick-fixes / refactors in a chooser; the chosen action’s edit is applied.codeAction
Code lensLists invokable lenses; running one executes its server command.codeLens, workspace/executeCommand, workspace/applyEdit
Expand / shrink selectionGrow or shrink the selection to the next syntactic range.selectionRange
Code foldingFold/unfold ranges the server reports (▾/▸ in the gutter; View → Editor).foldingRange
Inlay hintsInline type/parameter annotations (toggle in View → Editor).inlayHint
Linked editingEdit linked ranges (e.g. an open/close tag pair) together.linkedEditingRange
Colors and linksColors the server finds get a ■ swatch; Edit Color… (lsp.edit_color) lists the formats the server can write the color under the cursor in and applies the one you pick. Open Link (or Ctrl/Cmd+click) opens a link.documentColor, colorPresentation, documentLink
File changesRenaming (File → Rename), moving, copying, creating or deleting files and folders in the explorer or the directory editor first asks servers that want it for edits such as import updates (waiting at most 3 seconds), applies them, then tells the server. Servers that register file watchers are also told about outside changes to matching files anywhere in the workspace (a bounded scan every few seconds).willRenameFiles, didRenameFiles, willCreateFiles, didCreateFiles, willDeleteFiles, didDeleteFiles, didChangeWatchedFiles

Lifecycle (initialize/initialized/shutdown/exit) and document sync (didOpen/didChange/didClose/didSave) are handled automatically. A server that asks for incremental sync is sent only the changed range of each edit; others get the whole document. Semantic tokens are requested for the lines around the view when the server supports ranges, and refreshed shortly after you stop typing or scroll elsewhere.

Server status and progress

While a server reports work through $/progress — indexing a project, building, loading crates — the status bar shows the newest task beside the git branch, as language: title: message (n%), with +N when more tasks are in flight. It clears when the server reports the task ended.

View → LSP Status… lists every configured server, live:

  • its name (language id) and state: not started (no matching file opened yet), starting, running, or failed (the command would not start, or it crashed more often than the automatic respawn allows);
  • its command, workspace root, file extensions and number of open files;
  • its in-flight progress tasks;
  • the capabilities it advertised at initialize (hover, definition, rename, …);
  • its last error since it was last restarted: the command would not start, it exited unexpectedly, or the message of a failed request.

Use ↑/↓ to pick a server and r (or Enter) to restart it; Esc closes the panel. Tools → Language Server → Restart Server and Show Server Log act on the active file’s servers instead.

When no server is configured

Every LSP action degrades gracefully: with no server attached it reports “language server inactive” in the status line and does nothing else. Go-to-definition additionally falls back to a heuristic, language-agnostic search so the F12 jump still works without a server.


Vix™ and Vix IDE™ are trademarks.