mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-18 23:07:13 +09:00
LSP option and better LSP status
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user