aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Lingelbach <m.j.lbach@gmail.com>2021-01-12 13:09:41 -0800
committerGitHub <noreply@github.com>2021-01-12 22:09:41 +0100
commit953a548454869b8d4d513211fd15c429b4759eae (patch)
treea34792804435cff940e82cd8091975872c21e875
parent9f3b2a757b866cf117efecf3ca1a2233e77217d8 (diff)
downloadrneovim-953a548454869b8d4d513211fd15c429b4759eae.tar.gz
rneovim-953a548454869b8d4d513211fd15c429b4759eae.tar.bz2
rneovim-953a548454869b8d4d513211fd15c429b4759eae.zip
lsp: remove references to LspInstall (#13738)
and adjust sumneko setup instructions
-rw-r--r--runtime/doc/lsp.txt31
1 files changed, 25 insertions, 6 deletions
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
index c00b2ab4f8..b9affb02b2 100644
--- a/runtime/doc/lsp.txt
+++ b/runtime/doc/lsp.txt
@@ -27,9 +27,9 @@ Follow these steps to get LSP features:
1. Install the nvim-lspconfig plugin. It provides common configuration for
various servers so you can get started quickly.
https://github.com/neovim/nvim-lspconfig
- 2. Install a language server. Try ":LspInstall <tab>" or use your system
- package manager to install the relevant language server:
+ 2. Install a language server. A list of language servers can be found here:
https://microsoft.github.io/language-server-protocol/implementors/servers/
+ See individual server documentation for installation instructions.
3. Add `lua require('lspconfig').xx.setup{…}` to your init.vim, where "xx" is
the name of the relevant config. See the nvim-lspconfig README for details.
NOTE: Make sure to restart nvim after installing and configuring.
@@ -62,20 +62,39 @@ Example config (in init.vim): >
vim.api.nvim_buf_set_option(0, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
-- For plugins with an `on_attach` callback, call them here. For example:
- -- require('completion').on_attach(client)
+ -- require('completion').on_attach()
end
-- An example of configuring for `sumneko_lua`,
-- a language server for Lua.
- -- First, you must run `:LspInstall sumneko_lua` for this to work.
+
+ -- set the path to the sumneko installation
+ local system_name = "Linux" -- (Linux, macOS, or Windows)
+ local sumneko_root_path = '/path/to/lua-language-server'
+ local sumneko_binary = sumneko_root_path.."/bin/"..system_name.."/lua-language-server"
+
require('lspconfig').sumneko_lua.setup({
+ cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"};
-- An example of settings for an LSP server.
-- For more options, see nvim-lspconfig
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 = {
- enable = true,
- globals = { "vim" },
+ -- 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,
+ },
},
}
},