Repository navigation
[audit] Fix unsatisfiable kind check in tree-sitter-d2 PackChanged hook - #348
Draft
stanfish06 wants to merge 1 commit into
Draft
stanfish06 wants to merge 1 commit into
stanfish06 wants to merge 1 commit into
Conversation
The PackChanged callback for tree-sitter-d2 required kind to equal both "install" and "update" simultaneously, which is never true, so the `make nvim-install` native-parser build never ran after installing or updating the plugin. The surrounding handler already filters events to just install/update kinds before this branch runs (see the early return a few lines up), so the extra check was both redundant and wrong — drop it, matching the fff.nvim/blink.cmp branches above it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CV1pGQRo9Rzc64fQSsYpHQ
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.
What
lua/config/plugins.lua:232— thePackChangedautocmd'stree-sitter-d2branch required:kindis a single string; it can never equal"install"and"update"at the same time, so this branch is dead code — thevim.system({ "make", "nvim-install" }, ...)call that builds the native parser library for D2 diagram highlighting never runs aftervim.pack.add/vim.pack.updateinstall or update tree-sitter-d2.Where
lua/config/plugins.lua:206-239— thePackChangedhandler. The branch already runs under an early filter (if kind ~= "install" and kind ~= "update" then return end, line 209) that guaranteeskindis one of those two values by the time any branch executes, exactly as thefff.nvimandblink.cmpbranches above it already assume (neither re-checkskind).Why it matters
Without the native build step firing, a fresh install or update of
tree-sitter-d2leaves the D2 grammar's compiled parser missing/stale, breaking D2 diagram syntax highlighting/parsing until someone runsmake nvim-installby hand inside the plugin's pack directory.Fix
Drop the impossible extra condition so the branch matches its siblings:
Mechanical, one-line, no behavior change beyond making the existing intended build step actually run.
Generated by Claude Code