sourcegraph / tree-sitter-jsonnet

tree-sitter grammar for JSONNET
MIT License
16 stars 6 forks source link

with latest commit nvim-treesitter highlighting broken - `invalid node type at position .. for language jsonnet` #20

Closed peterbueschel closed 1 year ago

peterbueschel commented 1 year ago

Hi,

first thank you for this project.

with the latest update of the jsonnet parser in nvim-treesitter (PR) the highlight feature stopped working with the an error message similar to: invalid node type at position .. for language jsonnet

image

I am completely out of this parsing/query topic - but I tried to debug this a bit and find out that some changes made in the mentioned PR are the reason for this.

I manually commented out the parts in the queries/jsonnet/highlights.scm, which breaks the nvim-treesitter - and afterwards the highlight worked again:

[13-17]

(fieldaccess
  last: (id) @field)
(fieldaccess_super
  (id) @field)

[line 42-43]

(binary
  operator: (_) @operator)

[line 82-89]

(functioncall (id) @function.call)
(functioncall
  (fieldaccess
    last: (id) @function.call))
(functioncall
  (fieldaccess_super
    (id) @function.call))

So it looks like the new (not sure if this is the correct phrase) functions are somehow unknown. I checked my local files in the nvim-treesitter folder (using the master branch - lastest commit there):

and all are related to "jsonnet": { "revision": "d34615fa12cc1d1cfc1f1f1a80acc9db80ee4596" } - So, the lastest commit in this repo here.

So, I hope someone can have a look or point me to right direction.

Thank you.

0x0013 commented 1 year ago

I am observing the same issue.

peterbueschel commented 1 year ago

Hi again,

it looks like the issue was caused by the https://github.com/HiPhish/rainbow-delimiters.nvim plugin - they updated the queries on their end and now everything works as expected.

Means we latest version of nvim-treesitter + rainbow-delimiters.nvim everything is fine.