From b5b2e94faad9fe56dff4aa3edbc7c881a2fa9a03 Mon Sep 17 00:00:00 2001 From: tastytea Date: Wed, 10 Aug 2022 19:44:57 +0200 Subject: [PATCH] nvim: lsp: add lua-language-server support --- .config/nvim/lua/completion.lua | 6 ++++++ .config/nvim/lua/lsp.lua | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/.config/nvim/lua/completion.lua b/.config/nvim/lua/completion.lua index e84e7c5..9cbeae0 100644 --- a/.config/nvim/lua/completion.lua +++ b/.config/nvim/lua/completion.lua @@ -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({ diff --git a/.config/nvim/lua/lsp.lua b/.config/nvim/lua/lsp.lua index 0b874a5..75bc949 100644 --- a/.config/nvim/lua/lsp.lua +++ b/.config/nvim/lua/lsp.lua @@ -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 }