Skip to content

fix(nvim): fix LSP config pattern and disable luarocks for Neovim 0.12#108

Merged
guni1192 merged 2 commits into
mainfrom
fix/nvim-lsp-config-neovim-0-12
May 23, 2026
Merged

fix(nvim): fix LSP config pattern and disable luarocks for Neovim 0.12#108
guni1192 merged 2 commits into
mainfrom
fix/nvim-lsp-config-neovim-0-12

Conversation

@guni1192
Copy link
Copy Markdown
Owner

Summary

Neovim 0.12 で vim.lsp.enable(name, config) の inline config が無視される挙動に対応し、:checkhealth で出ていた警告とエラーを解消する。

修正内容

  • 全 LSP サーバー (rust-analyzer, gopls, clangd, terraformls, lua_ls) の設定パターンを vim.lsp.enable(name, config) から vim.lsp.config(name, config) + vim.lsp.enable(name) に変更
    • これまで custom settings が一切適用されていなかった (:checkhealth vim.lsp でデフォルト値が表示されていた)
  • gopls: -rpc.trace フラグを削除 (LSP ログが 133MB に肥大化していた原因)
  • gopls: filetypesgomod, gowork, gotmpl を追加 (Unknown filetype 警告の解消)
  • lazy.nvim: rocks = { enabled = false } を追加 (hererocks 未インストール ERROR の解消)

解消される checkhealth 警告

  • lazy: ❌ ERROR luarocks not installed
  • vim.lsp: ⚠️ WARNING 'rust-analyzer' config not found
  • vim.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 など) が反映されていることを確認
  • Go ファイルを開いて gopls が起動し、unusedparams analyzer が効くことを確認
  • Rust ファイルを開いて rust-analyzer が起動し、clippy 診断が出ることを確認
  • Lua ファイルを開いて lua_ls の globals = {'vim'} 設定が効いていることを確認
  • 数分編集した後で ls -lh ~/.local/state/nvim/lsp.log がほぼ増えないことを確認

guni1192 and others added 2 commits May 23, 2026 16:46
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>
@guni1192 guni1192 marked this pull request as ready for review May 23, 2026 08:28
@guni1192 guni1192 merged commit 101ea1c into main May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant