From d62fb1d17c2e79dd9520f5334d5d4d983359802d Mon Sep 17 00:00:00 2001 From: Michael Lingelbach Date: Mon, 21 Dec 2020 13:12:53 -0800 Subject: Update sumneko lua docs --- lua/lspconfig/sumneko_lua.lua | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'lua/lspconfig/sumneko_lua.lua') diff --git a/lua/lspconfig/sumneko_lua.lua b/lua/lspconfig/sumneko_lua.lua index 06bcf636..2b821766 100644 --- a/lua/lspconfig/sumneko_lua.lua +++ b/lua/lspconfig/sumneko_lua.lua @@ -121,6 +121,35 @@ require'lspconfig'.sumneko_lua.setup{ ``` If you install via our installer, if you execute `:LspInstallInfo sumneko_lua`, you can know `cmd` value. + +The settings of the language server can also be overridden. This is especially useful +when developing on the lua components of neovim. Some recommended settings are as follows: + +```lua +require'lspconfig'.sumneko_lua.setup { + 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 = vim.split(package.path, ';'), + }, + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = {'vim'}, + }, + workspace = { + -- Make the server aware of Neovim runtime files + library = { + [vim.fn.expand('$VIMRUNTIME/lua')] = true, + [vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true, + }, + }, + }, + }, +} +``` ]]; default_config = { root_dir = [[root_pattern(".git") or bufdir]]; -- cgit v1.2.3-70-g09d2