diff --git a/lua/telescope/_extensions/jj.lua b/lua/telescope/_extensions/jj.lua index 61e28f8..f107401 100644 --- a/lua/telescope/_extensions/jj.lua +++ b/lua/telescope/_extensions/jj.lua @@ -9,4 +9,21 @@ return telescope.register_extension({ -- access extension config and user config end, exports = require("telescope-jj"), + health = function() + if vim.fn.executable("jj") == 1 then + vim.health.ok("jj installed") + end + + local obj = vim.system({ "jj", "--version" }, { text = true }):wait() + for major, minor, patch in string.gmatch(obj.stdout, ".*(%d+).(%d+).(%d+)") do + if not (tonumber(major) == 0 and tonumber(minor) >= 20) then + vim.health.warn("requires jj version 0.20.0 or greater") + vim.health.info("found jj version: " .. major .. "." .. minor .. "." .. patch) + else + vim.health.ok( + "jj version " .. major .. "." .. minor .. "." .. patch .. " is supported" + ) + end + end + end, })