-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issues with parameters and flags #144
Conversation
thanks |
Thanks, it was something else in the neovim ts plugin and updating the plugin fixed the issue! I use TSUpdate as my build command so it's ran whenever I update nvim-treesitter (very often) |
I also created a similar issue #145 that I ran upon trying to test out melmass's report. |
@melMass Sorry, but I'd like to figure out the root cause here since other users may face the same problem. In my understanding, Would you please share your nvim config about this? |
@blindFS How so? The queries are the same in this repo and the repo that nvim pulls down. Neither queries work. Update: |
I think it's completely unrelated to this and just an upstream "bug" in nvim-treesitter. I realized that after having the same error message in a lua file (new session, no hidden nu buffers) which prompted me to update the plugin that fixed it in all languages
Oh wait I actually went a commit ealier while trying to solve the issue...: {
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
dependencies = {
{ 'nushell/tree-sitter-nu', commit = '45f9e51e5ee296dc0965a80f3d00178d985dffbd' }
} I'll remove it now, retry and report how it went |
Oh right, the issue is there my bad stack traceback:
[C]: in function '_ts_parse_query'
...0.10.2_1/share/nvim/runtime/lua/vim/treesitter/query.lua:252: in function 'fn'
...im/0.10.2_1/share/nvim/runtime/lua/vim/func/_memoize.lua:58: in function 'fn'
...im/0.10.2_1/share/nvim/runtime/lua/vim/func/_memoize.lua:58: in function 'get'
..._1/share/nvim/runtime/lua/vim/treesitter/highlighter.lua:28: in function 'new'
..._1/share/nvim/runtime/lua/vim/treesitter/highlighter.lua:243: in function 'get_query'
..._1/share/nvim/runtime/lua/vim/treesitter/highlighter.lua:191: in function 'fn'
...1/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:491: in function 'for_each_tree'
..._1/share/nvim/runtime/lua/vim/treesitter/highlighter.lua:178: in function 'prepare_highlight_states'
..._1/share/nvim/runtime/lua
Error in decoration provider treesitter/highlighter.win:
Error executing lua: ...0.10.2_1/share/nvim/runtime/lua/vim/treesitter/query.lua:252: Query error at 193:12. Impossible pattern:
(long_flag ["="] @punctuation.special)
^ I can provide more info as needed |
I think when you do |
I use Lazy to manage it so it's possible yep, but this confirms the issues is introduced by this merge |
@melMass would you please try to remove the dependency here: {
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
} And also clean-up the tree-sitter-nu plugin, then try again. |
Ohh I see what you meant, so it's now merged upstream and doesn't require the explicit dependency, this seems to work but I'm not sure how to know which "version" TS install on it's own. I get why they do that but it would be so much simpler to point to the maintained repos instead of PRing updates "manually" |
@melMass I think it is specified in the lockfile https://github.com/nvim-treesitter/nvim-treesitter/blob/master/lockfile.json |
Hmmm seems like it uses some old ones: $ cd .local/share/nvim/lazy/nvim-treesitter/queries
$ ls nu/
╭───┬───────────────────┬──────┬────────┬─────────────╮
│ # │ name │ type │ size │ modified │
├───┼───────────────────┼──────┼────────┼─────────────┤
│ 0 │ nu/indents.scm │ file │ 376 B │ 2 weeks ago │
│ 1 │ nu/highlights.scm │ file │ 5.6 KB │ 2 weeks ago │
│ 2 │ nu/injections.scm │ file │ 219 B │ 2 weeks ago │
╰───┴───────────────────┴──────┴────────┴─────────────╯ Ah but it's expected. Tbh I'm regularly confused by Treesitter even though I went quite deep into it at some point... Shouldn't we still be able to use this repo to get the latest updates? |
But that's "just" the parser, what I don't understand is why this PR doesn't work? A feature not yet in the treesitter version used in the plugin? |
This PR's update of highlights.scm only works with its corresponding grammar. If your grammar is some older version, the query of the "=" token in |
I think I get it now, so the saner approach for me seems to accept the slight delay upstream and just use that! Thanks for the help debugging this, I'll know how to switch from upstream to latest in case I need to |
@melMass Yes, we will keep minimum updates to queries files so this kind of trouble won't happen often. |
This PR fixes those parameter/flag related issues in #142