Skip to content

Commit b6ea30e

Browse files
Add simple healthcheck for markdown parser
1 parent 56959c5 commit b6ea30e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

lua/markdown/health.lua

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---@param name string
2+
local function parser_installed(name)
3+
local ok = pcall(vim.treesitter.query.parse, name, '')
4+
if ok then
5+
vim.health.ok(name .. ' parser installed')
6+
else
7+
vim.health.error(name .. ' parser not found')
8+
end
9+
end
10+
11+
local M = {}
12+
13+
function M.check()
14+
vim.health.start('Checking required treesitter parsers')
15+
parser_installed('markdown')
16+
end
17+
18+
return M

0 commit comments

Comments
 (0)