We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4be5156 commit 7c21f30Copy full SHA for 7c21f30
lua/fzf-lua/utils.lua
@@ -1470,7 +1470,11 @@ end
1470
---@return boolean
1471
function M.has_ts_parser(lang)
1472
if M.__HAS_NVIM_011 then
1473
- return vim.treesitter.language.add(lang) and true or false
+ return vim.treesitter.language.add(lang)
1474
+ -- ensure the language has a highlights parser or we get
1475
+ -- no highlights for langugaes like json/jsonc/toml/etc
1476
+ and #vim.treesitter.query.get_files(lang, "highlights") > 0
1477
+ or false
1478
else
1479
return (pcall(vim.treesitter.language.add, lang))
1480
end
0 commit comments