This commit is contained in:
Ivar Fatland
2026-04-18 18:33:57 +02:00
parent 6d7b46765c
commit 33ce9addb4
@@ -35,13 +35,14 @@ local is_initialized = false
---@class TSModule ---@class TSModule
---@field module_path string ---@field module_path string
---@field enable boolean|string[]|function(string): boolean ---@field enable boolean|string[]|function(string): boolean
---@field disable boolean|string[]|function(string): boolean ---@field disable? boolean|string[]|function(string): boolean
---@field keymaps table<string, string> ---@field keymaps? table<string, string>
---@field is_supported function(string): boolean ---@field is_supported function(string): boolean
---@field attach function(string) ---@field attach? function(string)
---@field detach function(string) ---@field detach? function(string)
---@field enabled_buffers table<integer, boolean> ---@field enabled_buffers? table<integer, boolean>
---@field additional_vim_regex_highlighting boolean|string[] ---@field additional_vim_regex_highlighting? boolean|string[]
---@field loaded? boolean
---@type {[string]: TSModule} ---@type {[string]: TSModule}
local builtin_modules = { local builtin_modules = {
@@ -412,6 +413,7 @@ function M.setup(user_data)
config.ignore_install = user_data.ignore_install or {} config.ignore_install = user_data.ignore_install or {}
config.parser_install_dir = user_data.parser_install_dir or nil config.parser_install_dir = user_data.parser_install_dir or nil
if config.parser_install_dir then if config.parser_install_dir then
---@diagnostic disable-next-line: param-type-mismatch
config.parser_install_dir = vim.fn.expand(config.parser_install_dir, ":p") config.parser_install_dir = vim.fn.expand(config.parser_install_dir, ":p")
end end
@@ -434,6 +436,7 @@ function M.setup(user_data)
recurse_modules(function(_, _, new_path) recurse_modules(function(_, _, new_path)
local data = utils.get_at_path(config.modules, new_path) local data = utils.get_at_path(config.modules, new_path)
assert(data ~= nil)
if data.enable then if data.enable then
enable_all(new_path) enable_all(new_path)
end end