fix(treesitter): suppress get_parser warnings via opts.error

This commit is contained in:
Riley Bruins
2024-09-14 12:57:33 -07:00
committed by Christian Clason
parent 7b71fdbc1e
commit 0f067cd34d
12 changed files with 80 additions and 53 deletions

View File

@ -1028,7 +1028,11 @@ end
---
--- @param lang? string language to open the query editor for. If omitted, inferred from the current buffer's filetype.
function M.edit(lang)
vim.treesitter.dev.edit_query(lang)
-- TODO(ribru17): Make edit_query return true upon success so we can just assert here
local _, err_msg = vim.treesitter.dev.edit_query(lang)
if err_msg then
error(err_msg)
end
end
return M