Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(checkhealth): support for neovim :checkhealth feature #215

Merged
merged 2 commits into from
Sep 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions lua/kulala/health.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
local CONFIG = require("kulala.config")
local GLOBALS = require("kulala.globals")
local FS = require("kulala.utils.fs")

local health = vim.health
local start = health.start
local ok = health.ok
local info = health.info
local warn = health.warn
local error = health.error

local M = {}

M.check = function()
info("{kulala.nvim} version " .. GLOBALS.VERSION)
if FS.command_exists("curl") then
ok("{curl} found")
else
error("{curl} not found")
end

start("Checking formatters")
for type, config in pairs(CONFIG.get().contenttypes) do
if not config.formatter then
warn(string.format("{%s} formatter not found", type))
else
ok(string.format("{%s} formatter: %s", type, table.concat(config.formatter, " ")))
end
end
end

return M