fix: help parser has been renamed to vimdoc

This commit is contained in:
Steven Arcangeli 2023-04-01 12:56:56 -07:00
parent 4b725dc8e5
commit bc2bc8b5d0
6 changed files with 28 additions and 6 deletions

View file

@ -199,6 +199,7 @@ M.help = {
end
end,
}
M.vimdoc = M.help
M.rust = {
postprocess = function(bufnr, item, match)

View file

@ -1,3 +1,5 @@
; This is for backwards-compatibility with old versions of nvim-treesitter
; The new versions have renamed this parser to "vimdoc"
(h1
(word)+ @name @start
(tag)

16
queries/vimdoc/aerial.scm Normal file
View file

@ -0,0 +1,16 @@
(h1
(word)+ @name @start
(tag)
(#set! "kind" "Interface")
) @type
(h2
(word)+ @name @start
(tag)
(#set! "kind" "Interface")
) @type
(tag
text: (word) @name
(#set! "kind" "Interface")
) @type

View file

@ -12,7 +12,10 @@ vim.filetype.add({
local langs = {}
for lang, _ in vim.fs.dir("queries") do
table.insert(langs, lang)
-- "help" has been renamed to "vimdoc"
if lang ~= "help" then
table.insert(langs, lang)
end
end
require("nvim-treesitter.configs").setup({
ensure_installed = langs,

View file

@ -1,16 +1,16 @@
local util = require("tests.test_util")
describe("treesitter help", function()
describe("treesitter vimdoc", function()
it("parses all symbols correctly", function()
util.test_file_symbols("treesitter", "./tests/treesitter/help_test.txt", {
util.test_file_symbols("treesitter", "./tests/treesitter/vimdoc_test.txt", {
{
kind = "Interface",
name = "help_test.txt",
name = "vimdoc_test.txt",
level = 0,
lnum = 1,
col = 0,
end_lnum = 1,
end_col = 15,
end_col = 17,
},
{
kind = "Interface",

View file

@ -1,4 +1,4 @@
*help_test.txt* *help_test*
*vimdoc_test.txt* *vimdoc_test*
--------------------------------------------------------------------------------
TEST INTRO *test-intro*