diff --git a/AGENTS.md b/AGENTS.md index cfd0082..cb113c5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -42,6 +42,11 @@ W → w Wq/WQ → wq Wqa/WQa/WQA → wqa Q → q Qa/QA → qa Add new aliases to the `pairs({…})` table — one line, no boilerplate. +**Mason LSP servers** — `pyright` and `bash-language-server` are npm-based. +They are wrapped in `vim.fn.executable('npm') == 1` so hosts without npm (e.g. +GPU servers) skip them silently. Do not remove this guard or add new npm-dependent +servers outside of it. + ## Version bump rules - `fix:` commits → patch (`X.Y.Z+1`) diff --git a/CHANGELOG.md b/CHANGELOG.md index e049061..291e245 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.5.1] - 2026-05-06 + +### Fixed +- `nvim/init.lua`: Mason no longer attempts to install `pyright` and + `bash-language-server` on hosts without npm/Node.js. Both servers use npm as + their install backend; the unconditional `ensure_installed` caused two noisy + failure messages on every Neovim launch on GPU servers. They are now guarded + behind `vim.fn.executable('npm') == 1`. Resolves #23. + +### Changed +- `CLAUDE.md`, `AGENTS.md`: documented the Mason npm-conditional LSP server + guard so agents and humans know not to remove it or add new npm-dependent + servers outside of it. + ## [1.5.0] - 2026-05-05 ### Added diff --git a/CLAUDE.md b/CLAUDE.md index 498c881..1470531 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -292,6 +292,13 @@ common Ex commands so accidental Shift-holding doesn't fail: Add new aliases to the `pairs({…})` table at the bottom of `init.lua` — one line, no per-command boilerplate. +**Mason LSP servers** — `pyright` and `bash-language-server` are installed by +Mason via npm. The config guards them behind `vim.fn.executable('npm') == 1` so +`ensure_installed` only includes them when npm is present on the host. Hosts +without Node.js (e.g. GPU servers) still get `clangd` and `lua_ls` (no npm +needed). Do not remove this guard or add other npm-dependent servers without +wrapping them in the same check. + --- ## fzf integration diff --git a/VERSION b/VERSION index bc80560..26ca594 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.0 +1.5.1 diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index 1c66a4a..e44a702 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -142,13 +142,16 @@ require('lazy').setup({ -- Server configs defined once; registration method differs by nvim version. -- nvim 0.11+: vim.lsp.config/enable (new built-in API, no lspconfig on_attach) -- nvim 0.9–0.10: lspconfig.server.setup() (classic API) - local servers = { + -- pyright and bashls install via npm; skip ensure_installed on hosts without npm. + local npm_servers = vim.fn.executable('npm') == 1 and { pyright = { capabilities = capabilities, settings = { python = { analysis = { useLibraryCodeForTypes = true } } }, }, - clangd = { capabilities = capabilities }, bashls = { capabilities = capabilities }, + } or {} + local servers = vim.tbl_extend('force', { + clangd = { capabilities = capabilities }, lua_ls = { capabilities = capabilities, settings = { @@ -159,7 +162,7 @@ require('lazy').setup({ }, }, }, - } + }, npm_servers) if vim.fn.has('nvim-0.11') == 1 then require('mason-lspconfig').setup({