mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-17 02:40:09 -04:00
refactor!: remove setting the update strategy
This commit is contained in:
parent
a60b2234bc
commit
079a50f66e
2 changed files with 2 additions and 9 deletions
|
|
@ -14,7 +14,6 @@ local M = {}
|
||||||
---@field ensure_installed string[]|string
|
---@field ensure_installed string[]|string
|
||||||
---@field ignore_install string[]
|
---@field ignore_install string[]
|
||||||
---@field auto_install boolean
|
---@field auto_install boolean
|
||||||
---@field update_strategy string
|
|
||||||
---@field parser_install_dir string|nil
|
---@field parser_install_dir string|nil
|
||||||
|
|
||||||
---@type TSConfig
|
---@type TSConfig
|
||||||
|
|
@ -24,7 +23,6 @@ local config = {
|
||||||
ensure_installed = {},
|
ensure_installed = {},
|
||||||
auto_install = false,
|
auto_install = false,
|
||||||
ignore_install = {},
|
ignore_install = {},
|
||||||
update_strategy = "lockfile",
|
|
||||||
parser_install_dir = nil,
|
parser_install_dir = nil,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -604,10 +602,6 @@ function M.get_parser_info_dir()
|
||||||
return M.get_parser_install_dir "parser-info"
|
return M.get_parser_install_dir "parser-info"
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.get_update_strategy()
|
|
||||||
return config.update_strategy
|
|
||||||
end
|
|
||||||
|
|
||||||
function M.get_ignored_parser_installs()
|
function M.get_ignored_parser_installs()
|
||||||
return config.ignore_install or {}
|
return config.ignore_install or {}
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -379,7 +379,7 @@ local function run_install(cache_folder, install_folder, lang, repo, with_sync,
|
||||||
end
|
end
|
||||||
|
|
||||||
local revision = repo.revision
|
local revision = repo.revision
|
||||||
if not revision and configs.get_update_strategy() == "lockfile" then
|
if not revision then
|
||||||
revision = get_revision(lang)
|
revision = get_revision(lang)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -583,8 +583,7 @@ function M.update(options)
|
||||||
utils.notify "Parsers are up-to-date!"
|
utils.notify "Parsers are up-to-date!"
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
local parsers_to_update = configs.get_update_strategy() == "lockfile" and outdated_parsers()
|
local parsers_to_update = outdated_parsers() or info.installed_parsers()
|
||||||
or info.installed_parsers()
|
|
||||||
if #parsers_to_update == 0 then
|
if #parsers_to_update == 0 then
|
||||||
utils.notify "All parsers are up-to-date!"
|
utils.notify "All parsers are up-to-date!"
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue