Skip to content

Commit 5cec1bb

Browse files
feat: improve advice in health check
## Details Add specific configuration with `require` & `setup` calls to the advice provided by the health check to make what the user should do clear.
1 parent d6aaa19 commit 5cec1bb

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

doc/render-markdown.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*render-markdown.txt* For 0.10.0 Last change: 2025 March 23
1+
*render-markdown.txt* For 0.10.0 Last change: 2025 March 24
22

33
==============================================================================
44
Table of Contents *render-markdown-table-of-contents*

lua/render-markdown/health.lua

+12-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ local state = require('render-markdown.state')
55
local M = {}
66

77
---@private
8-
M.version = '8.1.8'
8+
M.version = '8.1.9'
99

1010
function M.check()
1111
M.start('version')
@@ -50,7 +50,10 @@ function M.check()
5050
if obsidian.get_client().opts.ui.enable == false then
5151
return nil
5252
else
53-
return 'Ensure UI is disabled by setting ui = { enable = false } in obsidian.nvim config'
53+
return {
54+
'Disable the UI in your obsidian.nvim config',
55+
"require('obsidian').setup({ ui = { enable = false } })",
56+
}
5457
end
5558
end)
5659
end
@@ -80,7 +83,7 @@ end
8083
function M.disable_advice(language)
8184
return {
8285
string.format('Disable %s support to avoid this warning', language),
83-
string.format('Set { %s = { enabled = false } }', language),
86+
string.format("require('render-markdown').setup({ { %s = { enabled = false } })", language),
8487
}
8588
end
8689

@@ -116,7 +119,11 @@ function M.check_highlight(filetype)
116119
if has_highlighter then
117120
vim.health.ok(filetype .. ': highlight enabled')
118121
else
119-
vim.health.error(filetype .. ': highlight not enabled')
122+
-- TODO(1.0): update advice once module support is removed
123+
vim.health.error(filetype .. ': highlight not enabled', {
124+
'Enable the highlight module in your nvim-treesitter config',
125+
"require('nvim-treesitter.configs').setup({ highlight = { enable = true } })",
126+
})
120127
end
121128
end
122129

@@ -141,7 +148,7 @@ end
141148

142149
---@private
143150
---@param name string
144-
---@param validate? fun(plugin: any): string?
151+
---@param validate? fun(plugin: any): string[]?
145152
function M.check_plugin(name, validate)
146153
local has_plugin, plugin = pcall(require, name)
147154
if not has_plugin then

0 commit comments

Comments
 (0)