Enable lsp install plugin
This commit is contained in:
@@ -1,6 +1,19 @@
|
||||
local nvim_lsp = require 'lspconfig'
|
||||
local utils = require('utils')
|
||||
|
||||
local system_name
|
||||
if vim.fn.has("mac") == 1 then
|
||||
system_name = "macOS"
|
||||
elseif vim.fn.has("unix") == 1 then
|
||||
system_name = "Linux"
|
||||
elseif vim.fn.has('win32') == 1 then
|
||||
system_name = "Windows"
|
||||
else
|
||||
print("Unsupported system for sumneko")
|
||||
end
|
||||
|
||||
local sumneko_root_path = 'D:/tmp/lua-language-server'
|
||||
local sumneko_binary = sumneko_root_path.."/bin/"..system_name.."/lua-language-server"
|
||||
-- We use the default settings for ccls and pylsp: the option table can stay empty
|
||||
-- nvim_lsp.ccls.setup {}
|
||||
nvim_lsp.pyright.setup{}
|
||||
@@ -12,7 +25,6 @@ nvim_lsp.groovyls.setup{
|
||||
cmd = { "java", "-jar", "D:/tmp/groovy-language-server/build/libs/groovy-language-server-all.jar" }
|
||||
}
|
||||
|
||||
|
||||
-- Add additional capabilities supported by nvim-cmp
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities.textDocument.completion.completionItem.documentationFormat = { 'markdown', 'plaintext' }
|
||||
@@ -91,7 +103,7 @@ local on_attach = function(client, bufnr)
|
||||
end
|
||||
|
||||
-- Enable some language servers with the additional completion capabilities offered by nvim-cmp
|
||||
local servers = { 'clangd', 'pyright', 'cmake', 'jsonls' }
|
||||
local servers = {'clangd', 'pyright', 'cmake', 'jsonls'}
|
||||
for _, lsp in ipairs(servers) do
|
||||
nvim_lsp[lsp].setup {
|
||||
on_attach = on_attach,
|
||||
@@ -99,6 +111,19 @@ for _, lsp in ipairs(servers) do
|
||||
}
|
||||
end
|
||||
|
||||
nvim_lsp.sumneko_lua.setup{
|
||||
cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"},
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
|
||||
nvim_lsp.groovyls.setup{
|
||||
-- Unix
|
||||
cmd = { "java", "-jar", "D:/tmp/groovy-language-server/build/libs/groovy-language-server-all.jar" },
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
|
||||
local signs = { Error = " ", Warning = " ", Hint = " ", Information = " " }
|
||||
for type, icon in pairs(signs) do
|
||||
local hl = "LspDiagnosticsSign" .. type
|
||||
|
||||
Reference in New Issue
Block a user