fix(nvim): port config to nvim-treesitter main rewrite for 26.05 #126
No reviewers
Labels
No labels
bug
enhancement
in-progress
needs-info
needs-triage
p0
ready-for-agent
ready-for-human
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/nixos!126
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/nvim-2605"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
After upgrading
nbto NixOS 26.05, neovim failed on startup withnvim-treesitter.configs not found.Root cause (confirmed empirically)
26.05 ships the nvim-treesitter "main"-branch rewrite
(
0.10.0-unstable) on neovim 0.12.2. The rewrite removed thenvim-treesitter.configsmodule entirely. Because the whole lua config isone concatenated
lua << EOF … EOFchunk, the error attreesitter.lua(file 12 of 17) aborted everything after it — so
treesitter-textobjects,utils(none-ls),bufferline,which-keyandsopssilently neverloaded either.
Changes
treesitter.luavim.treesitter.start()in a FileType autocmd; drop deadrainbow/autotag/context_commentstringkeys + upstream-removedincremental_selectiontreesitter-textobjects.luanvim-treesitter-textobjectsplugin (it was never installed —af/if/ac/icnever worked before)utils.luadiagnostics.eslint(builtin removed upstream)project.luause_lsp/ignore_lsp→ nestedlsp = { enabled, ignore }init.luaget_active_clients()→get_clients({bufnr}); fix brokenclient.detach()→buf_detach_client()which-key.lua,bufferline.luanvim_buf_get_option→vim.bo[]default.nixnvim-treesitter-textobjects+alejandra/deadnix/statix/cppcheck(the none-ls sources that were warning "not executable")Verification
Built the full 26.05 plugin set and ran the config headless on real
neovim 0.12.2: clean startup (zero errors/warnings), treesitter
highlight attaches on a
.nixfile (non-bundled grammar →withAllGrammarsworks), none-ls loads and
deadnixruns.The shared
developmentmodule is also built on the 25.11 dev VM (underfw); the new textobjects config safely no-ops there (the old plugin lacksthe new module path). That VM is being upgraded to 26.05 anyway.
NixOS 26.05 ships the nvim-treesitter "main"-branch rewrite on neovim 0.12.2, which removed the nvim-treesitter.configs module. The startup call `require('nvim-treesitter.configs').setup{}` aborted the whole concatenated lua chunk, so treesitter, textobjects, none-ls, bufferline, which-key and sops all silently failed to load. - treesitter.lua: highlight via native vim.treesitter.start() in a FileType autocmd. Drop dead module keys (rainbow is handled by rainbow-delimiters, autotag/context_commentstring plugins were never installed) and incremental_selection (removed upstream with no drop-in replacement). - treesitter-textobjects.lua: rewrite to the new select API and add the nvim-treesitter-textobjects plugin in default.nix -- it was never in the plugin list, so af/if/ac/ic never actually worked before. - utils.lua: drop none-ls diagnostics.eslint (builtin removed upstream; it errored with "failed to load builtin eslint"). - project.lua: use_lsp/ignore_lsp -> nested lsp = { enabled, ignore }. - init.lua: vim.lsp.get_active_clients() -> get_clients({bufnr}); fix the broken client.detach() to buf_detach_client(). - which-key.lua / bufferline.lua: nvim_buf_get_option -> vim.bo[] accessor. - default.nix: add alejandra/deadnix/statix/cppcheck so the configured none-ls sources actually run instead of warning "not executable". Verified by building the full plugin set on nixos-26.05 and running the config headless on neovim 0.12.2: clean startup (zero errors/warnings), treesitter highlight attaches on a .nix file, none-ls + deadnix run.Validated and merged via
/land-pr(merge commit, at the author's explicit request).Checked: Conventional Commits title ✓, no
secrets.yaml/stateVersiontouched ✓, diff scoped toutils/modules/development/nvim/✓, no conflict ✓. The repo's pre-commit gate is eval-only and can't exercise nvim'scustomRCLua, so I built the neovim wrapper and ran it headless on a 25.11 host.One real finding, merged knowingly (not a build/deploy breaker): on 25.11 the old
nvim-treesitter-textobjectsplugin still resolves, so the newconfig/treesitter-textobjects.luaif not ok then returnguard doesn't fire andtextobjects.setup(...)hits a nil field —E5108: attempt to call field 'setup' (a nil value). Because the config is one concatenatedlua << EOFchunk, that aborts everything after it (none-ls, bufferline, which-key, sops). Build / eval /nixos-rebuild switchare unaffected — only nvim runtime is degraded. Blast radius: only thefwdevVM (25.11) imports this module besidesnb(26.05, where it works). Clears whenfwreaches 26.05.Follow-up guard if fixing sooner:
if not ok or type(textobjects.setup) ~= "function" then return end.