Skip to content

How to debug custom queries not loading #6372

Closed Answered by ayroblu
ayroblu asked this question in Q&A
Discussion options

You must be logged in to vote

My understanding from debugging after I realised that an invalid query in the lib folder would throw:

Code is here: https://github.com/neovim/neovim/blob/38e38d1b4/runtime/lua/vim/treesitter/query.lua#L94

local query_path = string.format('queries/%s/%s.scm', "tsx", "textobjects")
print(dump(vim.api.nvim_get_runtime_file(query_path, true)))
print(dump(vim.treesitter.query.get_files("tsx", "textobjects")))

First useful commands to see what is found, first print gets all the query files found (local config is found), second is what ends up being returned (doesn't have my file).

Then from reading the code, looks like it needs to have an extends on top, and just randomly tried, needs to be in …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@ayroblu
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by ayroblu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants