Skip to content
This repository has been archived by the owner on Nov 26, 2023. It is now read-only.

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

Open
lucasvianav opened this issue Aug 29, 2022 · 16 comments
Open

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

lucasvianav opened this issue Aug 29, 2022 · 16 comments

Comments

@lucasvianav
Copy link

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 lucasvianav changed the title Highlights broken after update with query: invalid node type Highlights broken after update with query: invalid node type Aug 29, 2022
@lucasvianav lucasvianav changed the title Highlights broken after update with query: invalid node type Highlights broken after update with query: invalid node type Aug 29, 2022
@lucasvianav lucasvianav changed the title Highlights broken after update with query: invalid node type Highlights broken after update with query: invalid node type Aug 29, 2022
@captainko
Copy link

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

@michaelwestphal
Copy link

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
Copy link

Temporary fix if you need da h1ghL1ghtZ:

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

@michaelwestphal
Copy link

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
Copy link

renxzen commented Oct 10, 2022

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

@steelsojka
Copy link
Collaborator

steelsojka commented Oct 10, 2022 via email

@kohane27
Copy link
Sponsor

kohane27 commented Nov 20, 2022

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
Copy link

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
Copy link

Aditeya commented Apr 10, 2023

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
Copy link

paulkre commented Aug 29, 2023

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

@osenvosem
Copy link

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

@Aditeya
Copy link

Aditeya commented Nov 6, 2023

@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
Copy link

@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
Copy link
Collaborator

@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
Copy link

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
Copy link
Collaborator

clason commented Nov 23, 2023

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests