nvim-treesitter/nvim-treesitter-angular

Highlights broken after update with query: invalid node type

lucasvianav opened this issue ยท 16 comments

After following the steps describe in nvim-treesitter/nvim-treesitter#3092, I discovered it was this plugin that was giving me the following error message whenever I opened more than one TypeScript file:

Error detected while processing BufReadPost Autocommands for "*":
Error executing lua callback: /tmp/.mount_nvim4vLa6p/usr/share/nvim/runtime/filetype.lua:20: Vim(append):Error executing lua callback: ...La6p/usr/share/nvim/runtime/lua/vim/treesitter/query.lua:174: query: invalid node type at position 3318
stack traceback:
        [C]: in function '_ts_parse_query'
        ...La6p/usr/share/nvim/runtime/lua/vim/treesitter/query.lua:174: in function 'get_query'
        ...r/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:36: in function 'new'
        ...nvim4vLa6p/usr/share/nvim/runtime/lua/vim/treesitter.lua:46: in function '_create_parser'
        ...nvim4vLa6p/usr/share/nvim/runtime/lua/vim/treesitter.lua:98: in function 'get_parser'
        .../start/nvim-treesitter/lua/nvim-treesitter/highlight.lua:155: in function 'start'
        .../start/nvim-treesitter/lua/nvim-treesitter/highlight.lua:161: in function 'attach'
        ...er/start/nvim-treesitter/lua/nvim-treesitter/configs.lua:477: in function 'attach_module'
        ...er/start/nvim-treesitter/lua/nvim-treesitter/configs.lua:500: in function 'reattach_module'
        ...er/start/nvim-treesitter/lua/nvim-treesitter/configs.lua:108: in function <...er/start/nvim-treesitter/lua/nvim-treesitter/configs.lua:107>
        [C]: in function 'nvim_buf_set_option'
        /tmp/.mount_nvim4vLa6p/usr/share/nvim/runtime/filetype.lua:20: in function </tmp/.mount_nvim4vLa6p/usr/share/nvim/runtime/filetype.lua:11>
stack traceback:
        [C]: in function 'nvim_buf_set_option'
        /tmp/.mount_nvim4vLa6p/usr/share/nvim/runtime/filetype.lua:20: in function </tmp/.mount_nvim4vLa6p/usr/share/nvim/runtime/filetype.lua:11>

If any more info is needed please let me know.

Hi @steelsojka, could you please check this issue because treesitter-angular is not usable right now. Thank you.

This is my experience at the moment too. I sadly disabled it for now in order to make sure treesitter still functions for TypeScript as a whole.

Temporary fix if you need da h1ghL1ghtZ:

use {'nvim-treesitter/nvim-treesitter', commit = '2bb9bb73'}

Sadly this didn't seem to work for me, but it could be user error on my part as I'm new to setting these things up and updating them.

Regardless, thank you!

Sad to see this isn't being fixed. this angular plugin was very useful for some of my projects

If someone is still struggling with this error, I can confirm that @elgiano solution works.
If you're using packer:

use({ "elgiano/nvim-treesitter-angular", branch = "topic/jsx-fix" })

Thank you elgiano again!

If someone is still struggling with this error, I can confirm that @elgiano solution works. If you're using packer:

use({ "elgiano/nvim-treesitter-angular", branch = "topic/jsx-fix" })

Thank you elgiano again!

I had both this issue and #2, and this seems to have fixed both.

I too ran into this issue, & @elgiano solution worked, would be great to see it merged.

config i used for Lazy.nvim:

return {
  "nvim-treesitter/nvim-treesitter",
  dependencies = {
    ...
    { "elgiano/nvim-treesitter-angular", branch = "topic/jsx-fix" }
  },
  ...
}

Syntax highlighting for inline templates does still not work for me. Even with @elgiano's fix.

@Aditeya do you have template highlighting working? Could you please post screenshot please?

@osenvosem I had it working last I used it, but I'm afraid I can't post any screenshots as I've left angular development and I don't have my previous configs.

@steelsojka Can you open up the repository so the community can work on it? Right now it's only you who can merge stuff.

@dlvandenberg I'm all for that as I can't give this repo the time it needs. However, anybody in the organization should be able to merge pull requests. I've added some of the other members as admins so I'm not a blocker if changes need to be made to settings of the repo.

Alright, cool :) I've been working on the grammar for the new control flow syntax of angular. Currently still in my forked repositories though. But should be able to create a PR once it's ready.

Is there a reason that the repositories for the parser and this one are separated?

Is there a reason that the repositories for the parser and this one are separated?

Yes, because queries are editor-specific.

But there is (afaict) zero reason for these queries not to be in nvim-treesitter. PR welcome (after which I'll archive this repo.)