LSP option and better LSP status

This commit is contained in:
Zachary Yedidia
2020-08-12 21:40:20 -04:00
parent c822a16596
commit 25f65a5f7b
8 changed files with 43 additions and 7 deletions

View File

@@ -34,9 +34,21 @@ function size(b)
end
function lsp(b)
if not b.Settings["lsp"] then
return "disabled"
end
if b:HasLSP() then
return "on"
end
local lsp = import("micro/lsp")
local l, ok = lsp.GetLanguage(b.Settings["filetype"])
if not ok then
return "unsupported"
end
if not l:Installed() then
return l.Command .. " not installed"
end
return "off"
end