A minimal client for exercising roundhouse-lsp
under VS Code's F5 dev loop. It spawns the locally-built binary and attaches
it to Ruby files, so you get inferred-type hovers, inlay hints, nil-safety
diagnostics, find-references, go-to-definition, and a request-trace
CodeLens above every controller action over a whole Rails app.
The server is found in this order: the roundhouse.serverPath setting;
a roundhouse binary on PATH (run as roundhouse lsp — the multi-call
binary a release tarball installs); and, for the F5 dev loop, the repo's
own ../../target/release/roundhouse-lsp. There is no packaging here yet:
a published .vsix is the natural next step once a release exists, and
needs nothing more than vsce package on this folder.
From the repo root, build the server:
cargo build --release --bin roundhouse-lspThen install the one client dependency (vscode-languageclient):
cd editors/vscode && npm install- Open this folder (
editors/vscode) in VS Code. - Press F5 (or run the "Run Roundhouse LSP" launch config). A second
window — the Extension Development Host — opens with
fixtures/real-blogalready loaded as the workspace. - In that window, open e.g.
app/controllers/articles_controller.rband hover over@article→Article.
Everything runs in the Extension Development Host window; the window you pressed F5 in is just the launcher/debugger.
After changing the Rust:
cargo build --release --bin roundhouse-lspThen press Cmd+R in the Extension Development Host window. That reloads the
extension, which respawns the binary — so you're testing the fresh build. No
copy, no repackage. (Editing extension.js is the same: Cmd+R picks it up.)
- Diagnostics — errors, syntax errors and static N+1 findings, in
the Problems panel. The analyzer's warning ledger (
gradual_untyped,unresolved_type; hundreds on a real app) is off by default: turn onroundhouse.warningsto publish it too. The setting takes effect on the next analysis pass, no reload. - Trace CodeLens —
▶ trace GET /rooms/:id · 9 filters · 2 skipped · trace completeabove each action (on theclassline for actions the controller inherits). Click it: the request chain — route, every filter with its guard and what it assigns, the action, the view with its partials, the layout, and the coverage footer — opens as a Markdown document (written under the OS temp dir, never into the app).
- Test a different Rails app: in the dev-host window, File → Open Folder. The LSP's workspace root follows whatever folder is open.
- Faster rebuilds: switch
'release'→'debug'inextension.jsand build withcargo build --bin roundhouse-lsp(quicker compile, slower binary). - Hide the inline
: Typeannotations (inlay hints) without losing hover — add to yoursettings.json:(Scoping to"[ruby]": { "editor.inlayHints.enabled": "off" }
[ruby]leaves inlay hints on for other languages.) - Server errors: the dev host's Output panel → "Roundhouse LSP" channel shows the server's stderr.
.rbfiles get therubylanguage id from VS Code's built-in Ruby grammar, so no other extension is required for the client to attach.
extension.js— spawns the binary, attaches torubydocuments.package.json— activation (onLanguage:ruby) and the client dependency..vscode/launch.json— the F5 config; opensfixtures/real-blogin the host.