Open joshfrench opened 2 years ago
Hi! It works for me... Can you execute :echo &ft
on the query buffer?
filetype is query
make sure that you have the query parser installed @joshfrench
I am having this same issue. I have the query parser installed too.
Same issue here too. query
parser is installed; ft
is query
. Is there any other information that would be helpful for diagnosing the issue?
Much like https://github.com/nvim-treesitter/playground/issues/51#issuecomment-915715794, the issue just magically resolved itself for me as well. I did poke some related config slightly, but I wasn't specifcally attempting to fix the issue.
In particular:
packer.nvim
, with the following treesitter configs:
use {
'nvim-treesitter/nvim-treesitter',
run = function()
local ts_update = require('nvim-treesitter.install').update({ with_sync = true })
ts_update()
end,
}
use {
'nvim-treesitter/playground',
config = function()
local ts = require('nvim-treesitter.configs')
ts.setup {
highlight = {
enable = true,
},
indent = { enable = true },
playground = {
enable = true,
disable = {},
updatetime = 25,
persist_queries = false,
keybindings = {
-- probably not relevant
},
},
}
end,
}
PackerInstall
and then PackerCompile
query
parser already being installed, as part of the above packer commandscpp
parser installed from before). I noticed the syntax highlighting was very different from what I was used to.rust
parser previously). The syntax highlighting was suddenly different there too.(identifier) @capture
). Hovering over @capture
highlighted all the identifiers in the source code.I think PackerInstall
/PackerCompile
happened to fix it, but I'd definitely done those commands previously with no luck. That, plus the number of others with this issue, makes me believe there is something else going on behind the scenes.
The general syntax highlighting (outside of playground) issue I saw might be related? If you're still struggling with this issue I definitely recommend setting highlight = { enable = true }
in your config, as it'll be immediately obvious if that starts working. Without the syntax highlighting change I'm not sure I would have noticed that the playground started working.
I just spent 30mn trying to understand why this didn't work when the solution was as simple as installing the "query" grammar: let's add it to requirements https://github.com/nvim-treesitter/playground#requirements . I've fixed the nix package so that installing playground installs the "query" grammar as well.
I use Packer. Removing ~/.local/share/nvim/site/pack/packer/start/playground
, reinstalling and recompiling fixed it for me.
also note that in neovim master's you can now do :lua vim.treesitter.show_tree()
The query editor doesn't seem to highlight anything:
I did see this other issue, which suggested making sure the
query
grammar is installed, but I've already done that. Any other ideas?Thanks!