mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
fix(install): don't prompt on installed parsers (skip)
Use `:TSInstall!` or `force = true` to reinstall.
This commit is contained in:
parent
12e0246e4f
commit
9365cf8a97
3 changed files with 5 additions and 11 deletions
2
TODO.md
2
TODO.md
|
|
@ -4,6 +4,8 @@ This document lists the planned and finished changes in this rewrite towards [Nv
|
|||
|
||||
## TODO
|
||||
|
||||
- [ ] **`config.lua`:** drop ensure_install (replace with install), ignore_install
|
||||
- [ ] **`install.lua`:** simply skip Tier 4 parsers (`get_install_info`)
|
||||
- [ ] **`parsers.lua`:** allow specifying version in addition to commit hash (for Tier 1)
|
||||
- [ ] **`parsers.lua`:** add WASM support (tier 1)
|
||||
- [ ] **`install.lua`:** migrate to async v2
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ function M.setup(user_data)
|
|||
if user_data then
|
||||
if user_data.install_dir then
|
||||
user_data.install_dir = vim.fs.normalize(user_data.install_dir)
|
||||
--TODO(clason): insert after/before site, or leave to user?
|
||||
--TODO(clason): leave to user!
|
||||
vim.opt.runtimepath:append(user_data.install_dir)
|
||||
end
|
||||
config = vim.tbl_deep_extend('force', config, user_data)
|
||||
|
|
|
|||
|
|
@ -365,12 +365,8 @@ local install_status = {} ---@type table<string,InstallStatus?>
|
|||
---@return InstallStatus status
|
||||
local function install_lang(lang, cache_dir, install_dir, force, generate)
|
||||
if not force and vim.list_contains(config.installed_parsers(), lang) then
|
||||
local yesno = fn.input(lang .. ' parser already available: would you like to reinstall ? y/n: ')
|
||||
print('\n ')
|
||||
if yesno:sub(1, 1) ~= 'y' then
|
||||
install_status[lang] = 'installed'
|
||||
return 'installed'
|
||||
end
|
||||
install_status[lang] = 'installed'
|
||||
return 'installed'
|
||||
end
|
||||
|
||||
if install_status[lang] then
|
||||
|
|
@ -444,10 +440,6 @@ M.install = a.sync(function(languages, options, callback)
|
|||
|
||||
languages = config.norm_languages(languages, options and options.skip)
|
||||
|
||||
if languages[1] == 'all' then
|
||||
options.force = true
|
||||
end
|
||||
|
||||
install(languages, options, callback)
|
||||
end, 3)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue