This repository has been archived on 2023-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/.config/nvim/lua/lsp/lua.lua

41 lines
1.8 KiB
Lua
Raw Normal View History

-- Author : swytch
-- Created : Tuesday May 18, 2021 12:08:51 CET
-- License : GPLv3
-- Description : sumneko (lua) config file for lsp
-- set the path to the sumneko installation; if you previously installed via the now deprecated :LspInstall, use
local sumneko_root_path = vim.fn.stdpath("data") ..
"/lsp_servers/sumneko_lua/extension/server"
2022-04-18 12:17:40 +02:00
local sumneko_binary = sumneko_root_path .. "/bin/" .. "/lua-language-server"
2021-10-30 15:29:45 +02:00
local runtime_path = vim.split(package.path, ';')
table.insert(runtime_path, "lua/?.lua")
table.insert(runtime_path, "lua/?/init.lua")
require'lspconfig'.sumneko_lua.setup {
cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"};
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
2021-10-30 15:29:45 +02:00
path = runtime_path,
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = {"vim", "use", "globals", "utils"},
},
workspace = {
-- Make the server aware of Neovim runtime files
2021-10-30 15:29:45 +02:00
library = vim.api.nvim_get_runtime_file("", true),
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
},
},
},
}