diff options
| author | Christian Clason <c.clason@uni-graz.at> | 2022-04-16 11:41:00 +0200 |
|---|---|---|
| committer | Christian Clason <christian.clason@uni-due.de> | 2022-04-30 11:42:46 +0200 |
| commit | bc25a6a5c4fd659bbf78ba0a2442ecf14eb00398 (patch) | |
| tree | 765ad28bc0745cbb0a4a41bea650a18d6d89ce88 | |
| parent | Update lockfile.json (diff) | |
| download | nvim-treesitter-bc25a6a5c4fd659bbf78ba0a2442ecf14eb00398.tar nvim-treesitter-bc25a6a5c4fd659bbf78ba0a2442ecf14eb00398.tar.gz nvim-treesitter-bc25a6a5c4fd659bbf78ba0a2442ecf14eb00398.tar.bz2 nvim-treesitter-bc25a6a5c4fd659bbf78ba0a2442ecf14eb00398.tar.lz nvim-treesitter-bc25a6a5c4fd659bbf78ba0a2442ecf14eb00398.tar.xz nvim-treesitter-bc25a6a5c4fd659bbf78ba0a2442ecf14eb00398.tar.zst nvim-treesitter-bc25a6a5c4fd659bbf78ba0a2442ecf14eb00398.zip | |
chore!: remove ensure_installed='maintained'
Removes all support (and tests) for the parser category "maintained", as
this is no longer a useful category.
BREAKING CHANGE: replace `ensure_installed='maintained'` by an explicit
list of parsers, or use `'all'` (not recommended).
| -rw-r--r-- | autoload/nvim_treesitter.vim | 4 | ||||
| -rw-r--r-- | lua/nvim-treesitter/install.lua | 11 | ||||
| -rw-r--r-- | lua/nvim-treesitter/parsers.lua | 13 | ||||
| -rw-r--r-- | tests/unit/parsers_spec.lua | 46 |
4 files changed, 3 insertions, 71 deletions
diff --git a/autoload/nvim_treesitter.vim b/autoload/nvim_treesitter.vim index 1216e9967..207911744 100644 --- a/autoload/nvim_treesitter.vim +++ b/autoload/nvim_treesitter.vim @@ -7,11 +7,11 @@ function! nvim_treesitter#foldexpr() abort endfunction function! nvim_treesitter#installable_parsers(arglead, cmdline, cursorpos) abort - return join(luaeval("require'nvim-treesitter.parsers'.available_parsers()") + ['all', 'maintained'], "\n") + return join(luaeval("require'nvim-treesitter.parsers'.available_parsers()") + ['all'], "\n") endfunction function! nvim_treesitter#installed_parsers(arglead, cmdline, cursorpos) abort - return join(luaeval("require'nvim-treesitter.info'.installed_parsers()") + ['all', 'maintained'], "\n") + return join(luaeval("require'nvim-treesitter.info'.installed_parsers()") + ['all'], "\n") endfunction function! nvim_treesitter#available_modules(arglead, cmdline, cursorpos) abort diff --git a/lua/nvim-treesitter/install.lua b/lua/nvim-treesitter/install.lua index b65c4b3f0..10f08dace 100644 --- a/lua/nvim-treesitter/install.lua +++ b/lua/nvim-treesitter/install.lua @@ -402,9 +402,6 @@ local function install(options) if ... == "all" then languages = parsers.available_parsers() ask = false - elseif ... == "maintained" then - languages = parsers.maintained_parsers() - ask = false else languages = vim.tbl_flatten { ... } ask = ask_reinstall @@ -467,15 +464,9 @@ function M.uninstall(...) path_sep = "\\" end - if vim.tbl_contains({ "all", "maintained" }, ...) then + if vim.tbl_contains({ "all" }, ...) then reset_progress_counter() local installed = info.installed_parsers() - if ... == "maintained" then - local maintained = parsers.maintained_parsers() - installed = vim.tbl_filter(function(l) - return vim.tbl_contains(maintained, l) - end, installed) - end for _, langitem in pairs(installed) do M.uninstall(langitem) end diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 4ac58758d..4a0e5208b 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -1085,19 +1085,6 @@ function M.available_parsers() end end -function M.maintained_parsers() - require("nvim-treesitter.utils").notify( - "ensure_installed='maintained' will be removed April 30, 2022. Specify parsers explicitly or use 'all'.", - vim.log.levels.WARN - ) - local has_tree_sitter_cli = vim.fn.executable "tree-sitter" == 1 and vim.fn.executable "node" == 1 - return vim.tbl_filter(function(lang) - return M.list[lang].maintainers - and not M.list[lang].experimental - and (has_tree_sitter_cli or not M.list[lang].install_info.requires_generate_from_grammar) - end, M.available_parsers()) -end - function M.get_parser_configs() return M.list end diff --git a/tests/unit/parsers_spec.lua b/tests/unit/parsers_spec.lua deleted file mode 100644 index d40578b87..000000000 --- a/tests/unit/parsers_spec.lua +++ /dev/null @@ -1,46 +0,0 @@ -local stub = require "luassert.stub" -local parsers = require "nvim-treesitter.parsers" - -describe("maintained_parsers", function() - before_each(function() - stub(vim.fn, "executable") - end) - - after_each(function() - vim.fn.executable:clear() - end) - - it("does not return experimental parsers", function() - local old_list = parsers.list - parsers.list = { - c = { - install_info = { - url = "https://github.com/tree-sitter/tree-sitter-c", - files = { "src/parser.c" }, - }, - maintainers = { "@vigoux" }, - }, - d = { - install_info = { - url = "https://github.com/CyberShadow/tree-sitter-d", - files = { "src/parser.c", "src/scanner.cc" }, - requires_generate_from_grammar = true, - }, - maintainers = { "@nawordar" }, - experimental = true, - }, - haskell = { - install_info = { - url = "https://github.com/tree-sitter/tree-sitter-haskell", - files = { "src/parser.c", "src/scanner.cc" }, - }, - }, - } - - local expected = { "c" } - - assert.same(parsers.maintained_parsers(), expected) - - parsers.list = old_list - end) -end) |
