mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
lsp: remove references to LspInstall (#13738)
and adjust sumneko setup instructions
This commit is contained in:
parent
9f3b2a757b
commit
953a548454
@ -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,
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user