diff --git a/lua/setup/lspinstall.lua b/lua/setup/lspinstall.lua index 4da0d3c..59a7879 100644 --- a/lua/setup/lspinstall.lua +++ b/lua/setup/lspinstall.lua @@ -1,5 +1,3 @@ -local utils = require('utils') - local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities.textDocument.completion.completionItem.documentationFormat = { 'markdown', 'plaintext' } capabilities.textDocument.completion.completionItem.snippetSupport = true @@ -127,6 +125,34 @@ lsp_installer.on_server_ready(function(server) return end + if server.name == 'sumneko_lua' then + local lua_rtp = vim.split(package.path, ';') + table.insert(lua_rtp, 'lua/?.lua') + table.insert(lua_rtp, 'lua/?/init.lua') + opts.settings = { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) + version = 'LuaJIT', + -- Setup your lua path + path = lua_rtp, + }, + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = { 'vim', 'use' }, + }, + workspace = { + -- Make the server aware of Neovim runtime files + library = vim.api.nvim_get_runtime_file('', true), + }, + -- Do not send telemetry data containing a randomized but unique identifier + telemetry = { + enable = false, + }, + }, + } + end + -- This setup() function is exactly the same as lspconfig's setup function (:help lspconfig-quickstart) server:setup(opts) vim.cmd([[ do User LspAttachBuffers ]])