Skip to content

Commit 69c13fc

Browse files
committed
feat: Add health check - closes #154
1 parent d17dd2c commit 69c13fc

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

lua/debugprint/health.lua

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
local M = {}
2+
3+
M.check = function()
4+
vim.health.start("debugprint.nvim report")
5+
6+
local global_opts = require("debugprint").get_global_opts()
7+
8+
if global_opts ~= nil then
9+
vim.health.ok(
10+
"debugprint is started with opts " .. vim.inspect(global_opts)
11+
)
12+
else
13+
vim.health.warn("debugprint is not yet started")
14+
end
15+
end
16+
17+
return M

lua/debugprint/init.lua

+5
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,11 @@ M.setup = function(opts)
419419
require("debugprint.setup").map_keys_and_commands(global_opts)
420420
end
421421

422+
---@return DebugprintGlobalOptions
423+
M.get_global_opts = function()
424+
return global_opts
425+
end
426+
422427
---@param filetypes DebugprintFileTypeConfig[]
423428
---@return nil
424429
M.add_custom_filetypes = function(filetypes)

0 commit comments

Comments
 (0)