nvim: lsp: add lua-language-server support
This commit is contained in:
parent
fd529cdd5f
commit
b5b2e94faa
|
@ -11,6 +11,9 @@ packer.use {
|
||||||
requires = 'https://github.com/neovim/nvim-lspconfig',
|
requires = 'https://github.com/neovim/nvim-lspconfig',
|
||||||
config = function()
|
config = function()
|
||||||
local cmp = require'cmp'
|
local cmp = require'cmp'
|
||||||
|
if (cmp == nil) then
|
||||||
|
return
|
||||||
|
end
|
||||||
cmp.setup({
|
cmp.setup({
|
||||||
snippet = {
|
snippet = {
|
||||||
expand = function(args)
|
expand = function(args)
|
||||||
|
@ -71,6 +74,9 @@ packer.use {
|
||||||
require('lspconfig')['clangd'].setup {
|
require('lspconfig')['clangd'].setup {
|
||||||
capabilities = capabilities
|
capabilities = capabilities
|
||||||
}
|
}
|
||||||
|
require('lspconfig')['sumneko_lua'].setup {
|
||||||
|
capabilities = capabilities
|
||||||
|
}
|
||||||
|
|
||||||
cmp.setup.filetype('lua', {
|
cmp.setup.filetype('lua', {
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
|
|
|
@ -68,5 +68,25 @@ packer.use {
|
||||||
},
|
},
|
||||||
on_attach = on_attach
|
on_attach = on_attach
|
||||||
}
|
}
|
||||||
|
|
||||||
|
require'lspconfig'.sumneko_lua.setup {
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
runtime = {
|
||||||
|
version = 'LuaJIT',
|
||||||
|
},
|
||||||
|
diagnostics = {
|
||||||
|
globals = {'vim'},
|
||||||
|
},
|
||||||
|
workspace = {
|
||||||
|
library = vim.api.nvim_get_runtime_file("", true),
|
||||||
|
},
|
||||||
|
telemetry = {
|
||||||
|
enable = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
on_attach = on_attach
|
||||||
|
}
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user