Skip to content

Commit c9ec34a

Browse files
authored
feat: healthcheck (#89)
1 parent 08b7843 commit c9ec34a

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

lua/elixir/elixirls/version.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
local version = [[
1+
local _version = [[
22
Erlang/OTP 24 [erts-12.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1]
33
44
Elixir 1.13.3 (compiled with Erlang/OTP 22)

lua/elixir/health.lua

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
local V = require("elixir.elixirls.version")
2+
local M = {}
3+
4+
function M.check()
5+
vim.health.start("elixir-tools.nvim report")
6+
7+
local version_string = vim.fn.system("elixir --version")
8+
local ex_version = V.elixir_version(version_string)
9+
local otp_version = V.erlang_version(version_string)
10+
11+
if type(ex_version) == "string" then
12+
vim.health.ok("Elixir v" .. ex_version)
13+
else
14+
vim.health.error("couldn't figure out elixir version")
15+
end
16+
17+
if type(otp_version) == "string" then
18+
vim.health.ok("OTP " .. otp_version)
19+
else
20+
vim.health.error("couldn't figure out OTP version")
21+
end
22+
end
23+
24+
return M

0 commit comments

Comments
 (0)