nvim-treesitter-angular icon indicating copy to clipboard operation
nvim-treesitter-angular copied to clipboard

Highlights broken after update with query: invalid node type

Open lucasvianav opened this issue 2 years ago • 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.

lucasvianav avatar Aug 29 '22 19:08 lucasvianav

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

captainko avatar Sep 22 '22 06:09 captainko

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.

michaelwestphal avatar Sep 23 '22 13:09 michaelwestphal

Temporary fix if you need da h1ghL1ghtZ:

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

theskabeater avatar Sep 23 '22 16:09 theskabeater

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!

michaelwestphal avatar Sep 23 '22 19:09 michaelwestphal

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

renxzen avatar Oct 10 '22 21:10 renxzen

I've been meaning to look into this. I don't develop angular anymore so it hasn't interfered with my daily work. A PR is surely welcomed for a speedier fix ;)

On Mon, Oct 10, 2022, 4:57 PM Renzo Mondragón @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/nvim-treesitter/nvim-treesitter-angular/issues/3#issuecomment-1273853128, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPXOSVVXGUDJJYMQ6FWBP3WCSGLDANCNFSM576742JQ . You are receiving this because you were mentioned.Message ID: @.***>

steelsojka avatar Oct 10 '22 22:10 steelsojka

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!

kohane27 avatar Nov 20 '22 07:11 kohane27

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.

s-jevtic avatar Mar 10 '23 15:03 s-jevtic

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" }
  },
  ...
}

Aditeya avatar Apr 10 '23 07:04 Aditeya

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

paulkre avatar Aug 29 '23 18:08 paulkre

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

osenvosem avatar Nov 05 '23 13:11 osenvosem

@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.

Aditeya avatar Nov 06 '23 05:11 Aditeya

@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 avatar Nov 22 '23 13:11 dlvandenberg

@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.

steelsojka avatar Nov 22 '23 21:11 steelsojka

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?

dlvandenberg avatar Nov 23 '23 14:11 dlvandenberg

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.)

clason avatar Nov 23 '23 14:11 clason