fix(nvim): fix LSP config pattern and disable luarocks for Neovim 0.12#108
Merged
Conversation
In Neovim 0.12, vim.lsp.enable(name, config) no longer applies the inline config — it must be set separately via vim.lsp.config(name, config). Convert all LSP servers (rust-analyzer, gopls, clangd, terraformls, lua_ls) to use vim.lsp.config() + vim.lsp.enable() pattern so that custom settings actually take effect. Also remove gopls's -rpc.trace flag that was bloating lsp.log to 133MB, add missing filetypes (gomod, gowork, gotmpl) to gopls, and disable lazy.nvim luarocks/hererocks support since no plugins require it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Takashi IIGUNI <takashi.iiguni@guni.dev>
Repo-scoped Claude Code skill that runs :checkhealth against this repo's Neovim config, triages errors/warnings, and fixes real config issues under nvim/. Captures the workflow used in 830b474 (Neovim 0.12 LSP API migration, lazy.nvim luarocks, gopls log bloat). Findings are bucketed into Fix / Suppress / Skip so optional deps the user hasn't opted into don't get installed just to silence warnings. Known recurring patterns are documented in references/known-issues.md — extend it as new patterns surface. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Takashi IIGUNI <takashi.iiguni@guni.dev>
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.
Summary
Neovim 0.12 で
vim.lsp.enable(name, config)の inline config が無視される挙動に対応し、:checkhealthで出ていた警告とエラーを解消する。修正内容
rust-analyzer,gopls,clangd,terraformls,lua_ls) の設定パターンをvim.lsp.enable(name, config)からvim.lsp.config(name, config)+vim.lsp.enable(name)に変更:checkhealth vim.lspでデフォルト値が表示されていた)-rpc.traceフラグを削除 (LSP ログが 133MB に肥大化していた原因)filetypesにgomod,gowork,gotmplを追加 (Unknown filetype 警告の解消)rocks = { enabled = false }を追加 (hererocks 未インストール ERROR の解消)解消される checkhealth 警告
lazy: ❌ ERROR luarocks not installedvim.lsp: ⚠️ WARNING 'rust-analyzer' config not foundvim.lsp: ⚠️ WARNING Unknown filetype 'gotmpl'vim.lsp: ⚠️ WARNING Log size: 133045 KB(将来発生する肥大化を防止)Test plan
:checkhealth lazyで luarocks ERROR が消えることを確認:checkhealth vim.lspで rust-analyzer 警告が消え、各 LSP の custom 設定 (gopls のstaticcheck/gofumpt, rust-analyzer のclippyなど) が反映されていることを確認unusedparamsanalyzer が効くことを確認globals = {'vim'}設定が効いていることを確認ls -lh ~/.local/state/nvim/lsp.logがほぼ増えないことを確認