mirror of
https://github.com/stevearc/aerial.nvim
synced 2024-09-16 14:34:08 +02:00
fix: help parser has been renamed to vimdoc
This commit is contained in:
parent
4b725dc8e5
commit
bc2bc8b5d0
6 changed files with 28 additions and 6 deletions
|
@ -199,6 +199,7 @@ M.help = {
|
|||
end
|
||||
end,
|
||||
}
|
||||
M.vimdoc = M.help
|
||||
|
||||
M.rust = {
|
||||
postprocess = function(bufnr, item, match)
|
||||
|
|
|
@ -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
16
queries/vimdoc/aerial.scm
Normal 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
|
|
@ -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,
|
||||
|
|
|
@ -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",
|
|
@ -1,4 +1,4 @@
|
|||
*help_test.txt* *help_test*
|
||||
*vimdoc_test.txt* *vimdoc_test*
|
||||
--------------------------------------------------------------------------------
|
||||
TEST INTRO *test-intro*
|
||||
|
Loading…
Reference in a new issue