Editor support¶
stone-lsp is a language server for stone, and the “stone” VS Code extension runs it. Any
editor that speaks the Language Server Protocol can use stone-lsp too: start it with no
arguments, speaking LSP over stdin and stdout, for files ending in .stn. With --mcp it
serves coding agents instead (see Coding agents).
Features¶
Diagnostics as you type, from the same checker
stone checkuses. A syntax error only affects the statement it is in, so the rest of the file keeps working while you type. Unused variables, parameters, functions, methods, types, and imports get a warning and are shown faded, asstone checkreports them.Hover shows a variable’s or expression’s inferred type, a function’s signature such as
fn add(a: int, b: int) -> int, or a builtin’s documentation. A function or variable also shows the//comment lines directly above its definition.Go to definition, find references, and rename for variables, parameters, and functions. Going to the definition of a builtin like
printopens a generatedbuiltins.stnthat documents every builtin.Outline of functions and variables, with each function’s parameters and locals.
Completion of names visible at the cursor, builtins, and keywords.
Formatting: Format Document (and format on save) rewrites the file as
stone fmtdoes.Packages (see Using packages) are read from the package store and from directories, as the compiler reads them, but never downloaded: a package that is not downloaded yet is an error at each
useof it and instone.toml, with the hint to runstone fetch, and the errors clear once it has run. Go to definition opens a package’s files, and a package’s names cannot be renamed. A file inside a package is checked as part of it, with the package’s own dependencies.
The VS Code extension also provides syntax highlighting, comment toggling, bracket matching, and
indentation after a line ending in :.
Installing¶
Install “stone” by tarolling from the VS Code Marketplace, or from Open VSX in editors such as
VSCodium. On Linux and macOS (x86-64 or arm64) and x86-64 Windows the extension bundles
stone-lsp. On other
platforms, or for other editors, install the server with
cargo install --git https://github.com/tarolling/stone stone-lsp
Settings¶
stone.server.path: thestone-lspexecutable to run. When empty (the default), the extension runs its bundled server, orstone-lsponPATHif it has none.
Coding agents (MCP)¶
stone-lsp --mcp serves the same analysis to coding agents over the
Model Context Protocol, as Pylance does for Python. Its tools
read programs from disk and analyze each file as part of its program, as the editor does:
tool |
does |
|---|---|
|
returns the guide to writing stone for agents, which the server asks agents to read first |
|
checks a file, or every |
|
checks a program given as text |
|
runs a program given as text with the interpreter, with optional input and arguments, returning its stdout, stderr, and how it ended; a step limit stops a loop that never ends |
|
describes what is at a position, as hover does |
|
says where the symbol at a position is defined |
|
lists every use of the symbol at a position |
|
outlines a file |
|
renames the symbol at a position in every file of its program, writing the files |
|
looks up a builtin function, method, type, module, or module function |
A position is a 1-based line plus either symbol, the name as it appears on that line, or a
1-based column. Relative paths start from the directory the server runs in, and answers show
paths relative to it.
The VS Code extension offers the server to VS Code’s agents on VS Code 1.101 and later, so its tools appear in Copilot’s agent mode with nothing to set up. For Claude Code, add it from the project’s directory with
claude mcp add stone -- stone-lsp --mcp
using stone-lsp from PATH (see above for installing it), or the full path to the server the
extension bundles. Any other agent that speaks MCP over stdio runs the same command.