mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-05 04:50:03 -04:00
feat: add option to auto-install missing parsers (#3130)
This commit is contained in:
parent
8f13ef1563
commit
365f0eb75f
4 changed files with 25 additions and 1 deletions
|
|
@ -13,6 +13,7 @@ local config = {
|
|||
modules = {},
|
||||
sync_install = false,
|
||||
ensure_installed = {},
|
||||
auto_install = false,
|
||||
ignore_install = {},
|
||||
update_strategy = "lockfile",
|
||||
parser_install_dir = nil,
|
||||
|
|
@ -386,6 +387,11 @@ function M.setup(user_data)
|
|||
config.parser_install_dir = vim.fn.expand(config.parser_install_dir, ":p")
|
||||
end
|
||||
|
||||
config.auto_install = user_data.auto_install or false
|
||||
if config.auto_install then
|
||||
require("nvim-treesitter.install").setup_auto_install()
|
||||
end
|
||||
|
||||
local ensure_installed = user_data.ensure_installed or {}
|
||||
if #ensure_installed > 0 then
|
||||
if user_data.sync_install then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue