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',
|
||||
config = function()
|
||||
local cmp = require'cmp'
|
||||
if (cmp == nil) then
|
||||
return
|
||||
end
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
|
@ -71,6 +74,9 @@ packer.use {
|
|||
require('lspconfig')['clangd'].setup {
|
||||
capabilities = capabilities
|
||||
}
|
||||
require('lspconfig')['sumneko_lua'].setup {
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
cmp.setup.filetype('lua', {
|
||||
sources = cmp.config.sources({
|
||||
|
|
|
@ -68,5 +68,25 @@ packer.use {
|
|||
},
|
||||
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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user