PaterJason / nvim-treesitter-sexp

MIT License
24 stars 4 forks source link

nvim-treesitter breaking change - rename `has-type` to `kind-eq` to align with Helix #6

Closed practicalli-johnny closed 3 months ago

practicalli-johnny commented 3 months ago

nvim-treesitter has a breaking change that renames has-type to kind-eq to align with Helix

https://github.com/nvim-treesitter/nvim-treesitter/commit/a80fe081b4c5890980561e0de2458f64aaffbfc7

Updating nvim-treesitter with this commit breaks nvim-treesitter-sexp commands.

Example error:

E5108: Error executing lua ...4-0.10.0/share/nvim/runtime/lua/vim/treesitter/query.lua:763: No handler for has-type?
stack traceback:
    [C]: in function 'error'
    ...4-0.10.0/share/nvim/runtime/lua/vim/treesitter/query.lua:763: in function 'match_preds'
    ...4-0.10.0/share/nvim/runtime/lua/vim/treesitter/query.lua:963: in function '(for generator)'
    .../lazy/nvim-treesitter-sexp/lua/treesitter-sexp/utils.lua:68: in function 'get_forms'
    .../lazy/nvim-treesitter-sexp/lua/treesitter-sexp/utils.lua:192: in function 'get_form'
    ...zy/nvim-treesitter-sexp/lua/treesitter-sexp/commands.lua:107: in function <...zy/nvim-treesitter-sexp/lua/treesitter-sexp/commands.lua:106>

Tested with AstroNvim 4 using lazy package manger

practicalli-johnny commented 3 months ago

As a temporary measure, I've been using the fork created for #7 in my AstroNvim config and it seems to be working well.

  {
    -- "PaterJason/nvim-treesitter-sexp",
    -- Practicalli fork with temporary fix
    "practicalli-johnny/nvim-treesitter-sexp-fork",
    branch = "treesitter-has-type-to-kind-eq",
    dependencies = { "nvim-treesitter/nvim-treesitter" },
    ft = { "clojure", "fennel", "janet", "query" },
    cmd = "TSSexp",
    opts = {},
  },