nvim-treesitter / nvim-treesitter-angular

Neovim treesitter integration with Angular
Apache License 2.0
22 stars 12 forks source link

Highlights broken after update with query: invalid node type #3

Open lucasvianav opened 1 year ago

lucasvianav commented 1 year ago

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.

captainko commented 1 year ago

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

michaelwestphal commented 1 year ago

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.

theskabeater commented 1 year ago

Temporary fix if you need da h1ghL1ghtZ:

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

michaelwestphal commented 1 year ago

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!

renxzen commented 1 year ago

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

steelsojka commented 1 year ago

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

kohane27 commented 1 year ago

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!

s-jevtic commented 1 year ago

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.

Aditeya commented 1 year ago

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" }
  },
  ...
}
paulkre commented 10 months ago

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

osenvosem commented 8 months ago

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

Aditeya commented 8 months ago

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

dlvandenberg commented 7 months ago

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

steelsojka commented 7 months ago

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

dlvandenberg commented 7 months ago

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?

clason commented 7 months ago

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