mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat: add "experimental" key to parsers
feat(ci): mark parsers as experimental in README
This commit is contained in:
parent
6b82b26a74
commit
e87ed0fdaa
4 changed files with 56 additions and 1 deletions
46
tests/unit/parsers_spec.lua
Normal file
46
tests/unit/parsers_spec.lua
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue