diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2021-03-04 18:59:09 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2021-03-04 18:59:09 +0100 |
| commit | 0619ad3d2898cbcd8f7b0e9be4a7f46753665d5c (patch) | |
| tree | 34c35876eb429e34575e22c64502c66db37424cc | |
| parent | 0b778bbd8446a769db56c970daa8dbe61ba7bef4 (diff) | |
| download | vis-lspc-0619ad3d2898cbcd8f7b0e9be4a7f46753665d5c.tar.gz vis-lspc-0619ad3d2898cbcd8f7b0e9be4a7f46753665d5c.zip | |
add check if the configured language sever is installed
| -rw-r--r-- | init.lua | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -637,6 +637,20 @@ local function ls_start_server(syntax) return nil, 'No language server available for ' .. syntax end + local exe = ls_conf.cmd:gmatch('%S+')() + if not os.execute('type ' .. exe .. '>/dev/null 2>/dev/null') then + -- remove the configured language server + lspc.ls_map[syntax] = nil + local msg = string.format( + 'Language server for %s configured but %s not found', + syntax, exe) + -- the warning will be visual if the language server was automatically startet + -- if the user tried to start teh server manually they will see msg as error + lspc_warn(msg) + return nil, msg + + end + if lspc.running[ls_conf.name] then return nil, 'Already a language server running for ' .. syntax end |
