Repository navigation
feat(nvim): Rust and TypeScript development support - #201
Merged
Merged
Conversation
rustaceanvim owns rust-analyzer (from rustup) with clippy as the on-save check, buffer-local <leader>r maps for runnables, testables, debuggables and macro expansion, the rust treesitter parser, and rustfmt via conform. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
crates.nvim runs as an in-process language server on Cargo.toml for version and feature completion, hover and code actions. taplo covers all TOML buffers; toml is excluded from format-on-save so hand-edited files only reformat on <leader>f. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Turn on kickstart's debug module. mason-nvim-dap installs codelldb, which rustaceanvim picks up for :RustLsp debuggables, and js-debug-adapter, wired as pwa-node/pwa-chrome with launch, tsx, and attach configurations for JS/TS buffers. delve stays out of ensure_installed because it needs a newer Go than is installed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rustaceanvim's adapter covers cargo tests and neotest-jest covers Jest projects next to vitest. New maps run the nearest test, rerun the last, debug the nearest via DAP, toggle the summary, and stop a run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eslint_d only produced diagnostics through nvim-lint. The eslint server runs the project's own eslint and also offers its fixes as code actions, with <leader>cE for LspEslintFixAll. nvim-lint keeps the prose linters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
package.json, tsconfig.json, GitHub workflow and other config files now get completion and validation. The catalog is required from before_init, so it only loads when a JSON or YAML server starts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When a biome.json[c] sits above the buffer, conform formats JS/TS with biome instead of prettier, and the biome language server attaches for diagnostics. Projects without a Biome config are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
typescript-tools talks to tsserver directly and ts_ls is never enabled, so the mason package was an unused install. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rustaceanvim checks vim.fn.executable('cargo-nextest') while building its
defaults, before user config is merged. When nextest is absent on WSL
that walks every /mnt/c PATH entry, adding about 120 ms to the first
Rust buffer. A package.preload hook answers that one lookup with a stat
of $CARGO_HOME/bin for the duration of the module load.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The parser-install guard called vim.fn.executable('tree-sitter') on every
startup. Mason's bin dir is often not on PATH yet at that point, so on
WSL the search walked the /mnt/c entries before reaching a mise shim,
adding 65-125 ms to roughly half of all startups. Check mason's copy
with fs_stat first and search PATH only when it is missing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why the change
Neovim had no Rust tooling and only partial TypeScript tooling, so this adds language servers, debugging, tests, linting and schemas for both, without slowing startup.
Special things to note
rustup component add rust-analyzer rust-src, and delve is left out of the debug installs because it needs a newer Go than is installed.package.preloadhook for rustaceanvim's nextest check, and a file check for mason'stree-sitter.Change outline
Most of the new Rust setup lives in its own plugin file. TypeScript changes extend the existing files.
Each JS/TS buffer now picks its formatter from the project:
Which tools serve each buffer:
First Rust buffer, before and after the nextest hook:
require('rustaceanvim.config.internal') build defaults enable_nextest = vim.fn.executable('cargo-nextest') - walk all 79 PATH entries, 42 under /mnt/c ~80-120 ms + stat $CARGO_HOME/bin/cargo-nextest ~0.01 ms merge vim.g.rustaceanvimDetails
Summary
Close the gaps that kept Neovim from being usable on a Rust + TypeScript
stack. Rust had no language server, parser, formatter, debugger, or test
adapter. TypeScript worked, but had no debugger, no ESLint fixes, no Jest
adapter, no JSON schemas, and no Biome support.
Changes
feat(nvim): add Rust support via rustaceanvim<leader>r…maps for runnables, testables, debuggables, macro expansion and error explanations, therustparser, rustfmtfeat(nvim): add Cargo.toml support with crates.nvim and taplofeat(nvim): enable DAP for Rust and TypeScriptpwa-node,pwa-chrome) with launch,tsx, and attach configsfeat(nvim): add Rust and Jest neotest adaptersfeat(nvim): use the ESLint language server for JS/TS<leader>cEfixes allfeat(nvim): add SchemaStore schemas to jsonls and yamllspackage.json,tsconfig.json, workflows; loads only when a JSON/YAML server startsfeat(nvim): format and lint with Biome in Biome projectsbiome.json[c]existschore(nvim): stop installing typescript-language-serverperf(nvim): skip rustaceanvim's PATH probe for cargo-nextestperf(nvim): stat mason's tree-sitter instead of searching PATHTesting
All checks ran headlessly against this source tree with isolated XDG dirs.
Nothing was applied to the live config.
<leader>rmaps and rustfmt active.Cargo.toml.prefer-const, andLspEslintFixAllrewrotelettoconst.package.jsonusing SchemaStore schemas.pre-commit(stylua) passes.Startup, randomized A/B against
master(medians, middle half in brackets):.rsfile.tsfile.jsonfileThe Rust increase is almost all
vim.treesitter.startloading the Rustgrammar for the first time; master had no Rust parser.
Notes
rustup component add rust-analyzer rust-src(already done on this machine).ensure_installed: current delve needs Go ≥ 1.25 and 1.23.1 is installed.🤖 Generated with Claude Code