[Backport release-0.8] feat(docs): update parser, HTML gen (#20737)

Note: although the tolerance in help_spec.lua increased, the actual
error count with the new parser decreased by about 20%. The difference
is that the old ignore_parse_error() ignored many more errors with the
old parser.

fix https://github.com/neovim/tree-sitter-vimdoc/issues/37
fix https://github.com/neovim/tree-sitter-vimdoc/issues/44
fix https://github.com/neovim/tree-sitter-vimdoc/issues/47

(cherry picked from commit 10ae8ccbf2)
This commit is contained in:
github-actions[bot]
2022-10-19 06:02:01 -07:00
committed by GitHub
parent f76473898d
commit f73bc880f4
11 changed files with 93 additions and 54 deletions

View File

@@ -19,10 +19,11 @@ describe(':help docs', function()
local rv = exec_lua([[return require('scripts.gen_help_html').validate('./build/runtime/doc')]])
-- Check that we actually found helpfiles.
ok(rv.helpfiles > 100, '>100 :help files', rv.helpfiles)
eq({}, rv.invalid_links, 'found invalid :help tag links')
eq({}, rv.invalid_urls, 'found invalid URLs in :help docs')
-- Check that parse errors did not increase wildly.
-- TODO: Fix all parse errors in :help files.
ok(rv.err_count < 100, '<100 parse errors', rv.err_count)
eq({}, rv.invalid_links, exec_lua([[return 'found invalid :help tag links:\n'..vim.inspect(...)]], rv.invalid_links))
ok(rv.err_count < 350, '<350 parse errors', rv.err_count)
end)
it('gen_help_html.lua generates HTML', function()
@@ -43,7 +44,7 @@ describe(':help docs', function()
tmpdir
)
eq(4, #rv.helpfiles)
ok(rv.err_count == 0, '0 parse errors', rv.err_count)
eq({}, rv.invalid_links, exec_lua([[return 'found invalid :help tag links:\n'..vim.inspect(...)]], rv.invalid_links))
ok(rv.err_count < 25, '<25 parse errors', rv.err_count)
eq({}, rv.invalid_links, 'found invalid :help tag links')
end)
end)