fix: don't install parser if it is already configured

This commit is contained in:
Guz
2026-01-10 10:00:32 -03:00
parent 79d9315988
commit 568b6420e6

View File

@@ -1,3 +1,12 @@
local parsers_ok, ts_parsers = pcall(require, "nvim-treesitter.parsers")
if not parsers_ok then
return
end
if ts_parsers.has_parser('gdshader') then
return
end
local ok, ts_configs = pcall(require, "nvim-treesitter.configs")
if not ok then
return
@@ -17,14 +26,13 @@ vim.filetype.add({
},
})
local parsers_ok, ts_parsers = pcall(require, "nvim-treesitter.parsers")
if parsers_ok then
local parser_configs = ts_parsers.get_parser_configs()
parser_configs.gdshader = {
used_by = { "gdshader" }, -- filetype
install_info = {
url = "", -- no external parser
files = {}, -- no parser files
url = "", -- no external parser
files = {}, -- no parser files
generate_requires_npm = false,
requires_generate_from_grammar = false,
},