Skip to content

Fix StyLua formatting in lualine arborist update check#327

Merged
djensenius merged 11 commits into
mainfrom
copilot/move-to-arborist-nvim
Jun 26, 2026
Merged

Fix StyLua formatting in lualine arborist update check#327
djensenius merged 11 commits into
mainfrom
copilot/move-to-arborist-nvim

Conversation

Copilot AI commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Migrates the Neovim tree-sitter setup from the archived nvim-treesitter to arborist.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.nvim migration: add arborist-ts/arborist.nvim plugin spec; remove nvim-treesitter plugin/config modules and drop nvim-treesitter dependencies from related plugin specs (aerial, go, neotest, render-markdown, treesitter-context, pkl). The pkl parser now installs via arborist's ensure_installed instead of TSInstall.
  • 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-parser git fetch) with an honest cadence-based "update due" indicator. Clicking the indicator always runs :ArboristUpdate so the first cadence check can initialize last_update. Multi-condition guards are wrapped to satisfy StyLua.
  • nvim/README.md and .luarc.json: document arborist.nvim, correct the indentation note (arborist sets a per-buffer indentexpr), and remove the stale incremental-selection bullet (that feature came from the now-removed treesitter-modules.nvim).

Notes

  • nvim-treesitter-textobjects and nvim-treesitter-context remain (they are standalone plugins, not the archived core).

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 requested a review from djensenius June 25, 2026 18:52
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
@djensenius
djensenius marked this pull request as ready for review June 25, 2026 20:35
@djensenius
djensenius requested a review from Copilot June 25, 2026 20:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.nvim plugin configuration and remove nvim-treesitter plugin/config modules.
  • Update related plugins/docs to no longer declare nvim-treesitter as a dependency and to document arborist.nvim instead.
  • 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 thread nvim/lua/plugins/lualine.lua Outdated
Comment on lines +1 to +3
return {
"arborist-ts/arborist.nvim",
lazy = false,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@djensenius
djensenius requested a review from Copilot June 25, 2026 20:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

  • Files reviewed: 12/12 changed files
  • Comments generated: 3
  • Review effort level: Low

Comment thread nvim/lua/plugins/lualine.lua Outdated
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 thread nvim/README.md Outdated
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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

  • Files reviewed: 13/13 changed files
  • Comments generated: 2
  • Review effort level: Low

Comment thread nvim/lua/plugins/lualine.lua Outdated
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 thread nvim/README.md Outdated
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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

  • Files reviewed: 13/13 changed files
  • Comments generated: 3
  • Review effort level: Low

Comment on lines +1 to +4
return {
"arborist-ts/arborist.nvim",
lazy = false,
priority = 100,
Comment thread nvim/lua/plugins/lualine.lua Outdated
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 thread nvim/README.md Outdated
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)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

  • Files reviewed: 13/13 changed files
  • Comments generated: 1
  • Review effort level: Low

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

  • Files reviewed: 13/13 changed files
  • Comments generated: 0 new
  • Review effort level: Low

@djensenius
djensenius merged commit 48f6913 into main Jun 26, 2026
6 checks passed
@djensenius
djensenius deleted the copilot/move-to-arborist-nvim branch June 26, 2026 13:17
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.

3 participants