Fix StyLua formatting in lualine arborist update check#327
Merged
Conversation
Copilot
AI
changed the title
[WIP] Switch from nvim-tree-sitter to arborist.nvim
Migrate Neovim tree-sitter setup to arborist.nvim
Jun 25, 2026
Copilot
AI
changed the title
Migrate Neovim tree-sitter setup to arborist.nvim
Merge latest main into copilot/move-to-arborist-nvim
Jun 25, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Neovim configuration to use arborist.nvim as the tree-sitter parser/query manager and removes nvim-treesitter (and related integration points) across plugin configs and documentation.
Changes:
- Add
arborist-ts/arborist.nvimplugin configuration and removenvim-treesitterplugin/config modules. - Update related plugins/docs to no longer declare
nvim-treesitteras a dependency and to documentarborist.nviminstead. - Refactor the lualine “tree-sitter updates” logic to read arborist state (but the current implementation appears incorrect; see comments).
Show a summary per file
| File | Description |
|---|---|
nvim/README.md |
Updates documentation to describe arborist.nvim instead of nvim-treesitter. |
nvim/lua/plugins/treesitter-modules.lua |
Removes the treesitter-modules.nvim plugin config (previously wrapped nvim-treesitter modules). |
nvim/lua/plugins/treesitter-context.lua |
Drops explicit dependency on nvim-treesitter. |
nvim/lua/plugins/render-markdown.lua |
Drops explicit dependency on nvim-treesitter. |
nvim/lua/plugins/nvim-treesitter.lua |
Removes the nvim-treesitter plugin spec/config. |
nvim/lua/plugins/nvim-treesitter-textobjects.lua |
Adjusts loading strategy (event-based) for textobjects without relying on nvim-treesitter being present. |
nvim/lua/plugins/neotest.lua |
Drops explicit dependency on nvim-treesitter. |
nvim/lua/plugins/lualine.lua |
Reworks tree-sitter update indicator to consult arborist state (currently appears to always report “up to date”). |
nvim/lua/plugins/go.lua |
Drops explicit dependency on nvim-treesitter. |
nvim/lua/plugins/arborist.lua |
Adds arborist.nvim plugin spec/config. |
nvim/lua/plugins/aerial.lua |
Drops explicit dependency on nvim-treesitter. |
.luarc.json |
Updates Lua LS library path from nvim-treesitter to arborist.nvim. |
Review details
- Files reviewed: 12/12 changed files
- Comments generated: 2
- Review effort level: Low
Comment on lines
+1
to
+3
| return { | ||
| "arborist-ts/arborist.nvim", | ||
| lazy = false, |
Contributor
Author
There was a problem hiding this comment.
Clarified the PR description so it now calls out that the arborist migration changes are part of this diff as well.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot
AI
changed the title
Merge latest main into copilot/move-to-arborist-nvim
Fix StyLua formatting in lualine arborist update check
Jun 25, 2026
Comment on lines
32
to
56
| local function get_outdated_parsers() | ||
| local outdated = {} | ||
| local parsers = require("nvim-treesitter.info").installed_parsers() | ||
| local lockfile_path = vim.fn.stdpath("data") .. "/lazy/nvim-treesitter/lockfile.json" | ||
| local lockfile = {} | ||
|
|
||
| if vim.fn.filereadable(lockfile_path) == 1 then | ||
| local content = vim.fn.readfile(lockfile_path) | ||
| local json = vim.fn.json_decode(table.concat(content, "\n")) | ||
| lockfile = json | ||
| local ok, lock = pcall(require, "arborist.lock") | ||
| if not ok or type(lock) ~= "table" or type(lock.read) ~= "function" then | ||
| return outdated | ||
| end | ||
|
|
||
| for _, lang in pairs(parsers) do | ||
| local revision_file = vim.fn.stdpath("data") .. "/site/parser/" .. lang .. ".revision" | ||
| if vim.fn.filereadable(revision_file) == 1 then | ||
| local installed_rev = vim.fn.readfile(revision_file)[1] | ||
| local expected_rev = lockfile[lang] and lockfile[lang].revision | ||
| local read_ok, data = pcall(lock.read) | ||
| if not read_ok or type(data) ~= "table" or type(data.parsers) ~= "table" then | ||
| return outdated | ||
| end | ||
|
|
||
| if expected_rev and installed_rev ~= expected_rev then | ||
| table.insert(outdated, lang) | ||
| end | ||
| local ok_cfg, cfg = pcall(require, "arborist.config") | ||
| local ok_update, update = pcall(require, "arborist.update") | ||
| if | ||
| ok_cfg | ||
| and ok_update | ||
| and type(cfg.values) == "table" | ||
| and type(update.due) == "function" | ||
| and update.due(cfg.values.update_cadence) | ||
| then | ||
| for lang in pairs(data.parsers) do | ||
| table.insert(outdated, lang) | ||
| end | ||
| end |
Comment on lines
+342
to
+344
| - **Incremental Selection**: Provided by Neovim 0.12 tree-sitter core defaults | ||
| - **Text Objects**: Enhanced with `nvim-treesitter-textobjects` | ||
| - **Smart Indentation**: Enabled for most languages (disabled for Python due to conflicts) | ||
| - **Smart Indentation**: Tree-sitter indentation handled automatically by arborist |
Comment on lines
+6
to
+10
| require("arborist").setup({ | ||
| install_popular = true, | ||
| update_cadence = "weekly", | ||
| ensure_installed = require("config.treesitter-parsers"), | ||
| }) |
- lualine: replace misleading per-parser 'outdated' list (arborist's lock has no outdated flag) with an honest cadence-based 'update due' indicator that runs :ArboristUpdate on click - pkl: drop nvim-treesitter dependency and TSInstall build; arborist installs the pkl parser via ensure_installed - README: clarify tree-sitter indentation comes from Neovim core, not arborist
Comment on lines
151
to
164
| if ts_update_due() then | ||
| vim.notify( | ||
| "Outdated Parsers:\n" .. table.concat(outdated, "\n"), | ||
| "Checking tree-sitter parsers for updates...", | ||
| vim.log.levels.INFO, | ||
| { title = "Tree-sitter Updates" } | ||
| { title = "Tree-sitter" } | ||
| ) | ||
| vim.cmd("ArboristUpdate") | ||
| else | ||
| vim.notify("All parsers up to date!", vim.log.levels.INFO, { title = "Tree-sitter" }) | ||
| vim.notify( | ||
| "Tree-sitter parser update not due yet.", | ||
| vim.log.levels.INFO, | ||
| { title = "Tree-sitter" } | ||
| ) | ||
| end |
Comment on lines
+341
to
+344
| #### Advanced Features | ||
| - **Incremental Selection**: `gnn` to expand selection, `gnd` to shrink | ||
| - **Incremental Selection**: Provided by Neovim 0.12 tree-sitter core defaults | ||
| - **Text Objects**: Enhanced with `nvim-treesitter-textobjects` | ||
| - **Smart Indentation**: Enabled for most languages (disabled for Python due to conflicts) | ||
| - **Smart Indentation**: Provided by Neovim's tree-sitter core (parsers managed by `arborist.nvim`) |
…ncremental-selection doc - lualine: clicking the tree-sitter indicator now always runs :ArboristUpdate so the first cadence check can initialize last_update (due() returns false until then) - README: remove the Incremental Selection bullet; that feature was provided by the now-removed treesitter-modules.nvim and is not a Neovim core default
Comment on lines
+1
to
+4
| return { | ||
| "arborist-ts/arborist.nvim", | ||
| lazy = false, | ||
| priority = 100, |
Comment on lines
42
to
44
| if type(lock.read) ~= "function" or type(update.due) ~= "function" or type(cfg.values) ~= "table" then | ||
| return false | ||
| end |
Comment on lines
+341
to
+343
| #### Advanced Features | ||
| - **Incremental Selection**: `gnn` to expand selection, `gnd` to shrink | ||
| - **Text Objects**: Enhanced with `nvim-treesitter-textobjects` | ||
| - **Smart Indentation**: Enabled for most languages (disabled for Python due to conflicts) | ||
| - **Smart Indentation**: Provided by Neovim's tree-sitter core (parsers managed by `arborist.nvim`) |
- README: attribute tree-sitter indentation to arborist's per-buffer indentexpr - lualine: keep the type-check guard on StyLua's canonical single line (it fits within the column limit; wrapping would fail StyLua --check)
Comment on lines
+36
to
+43
| local ok_lock, lock = pcall(require, "arborist.lock") | ||
| local ok_cfg, cfg = pcall(require, "arborist.config") | ||
| local ok_update, update = pcall(require, "arborist.update") | ||
| if not (ok_lock and ok_cfg and ok_update) then | ||
| return false | ||
| end | ||
| if type(lock.read) ~= "function" or type(update.due) ~= "function" or type(cfg.values) ~= "table" then | ||
| return false |
Mirror the arborist update_cadence locally instead of reaching into arborist.config.values, removing the dependency on arborist's internal config shape. update.due() still receives an explicit cadence (it requires one), preserving correct behavior.
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
Migrates the Neovim tree-sitter setup from the archived
nvim-treesittertoarborist.nvim, and reworks the lualine tree-sitter status indicator to match arborist's API. This PR contains the full migration diff plus follow-up fixes from review — not just StyLua formatting.Changes
arborist.nvimmigration: addarborist-ts/arborist.nvimplugin spec; removenvim-treesitterplugin/config modules and dropnvim-treesitterdependencies from related plugin specs (aerial, go, neotest, render-markdown, treesitter-context, pkl). Thepklparser now installs via arborist'sensure_installedinstead ofTSInstall.nvim/lua/plugins/lualine.lua: replace the old per-parser "outdated" list (arborist's lock has no outdated flag, and real staleness needs a per-parsergit fetch) with an honest cadence-based "update due" indicator. Clicking the indicator always runs:ArboristUpdateso the first cadence check can initializelast_update. Multi-condition guards are wrapped to satisfy StyLua.nvim/README.mdand.luarc.json: documentarborist.nvim, correct the indentation note (arborist sets a per-bufferindentexpr), and remove the stale incremental-selection bullet (that feature came from the now-removedtreesitter-modules.nvim).Notes
nvim-treesitter-textobjectsandnvim-treesitter-contextremain (they are standalone plugins, not the archived core).