-
Notifications
You must be signed in to change notification settings - Fork 12
update: neovim config instructions #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The LuaRocks section applies aswell.
@@ -55,21 +55,32 @@ Below are some examples for getting set up in Neovim in different environments. | |||
Below is a minimal example showing how to set the runtime version of the language server. | |||
|
|||
```Lua | |||
require'lspconfig'.lua_ls.setup{ | |||
vim.lsp.config['luals'] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From experience I've found calling vim.lsp.config()
to be a safer bet:
vim.lsp.config('lua_ls', ...)
-- Sets the "workspace" to the directory where any of these files is found. | ||
-- Files that share a root directory will reuse the LSP server connection. | ||
-- Nested lists indicate equal priority, see vim.lsp.Config. | ||
root_markers = { { '.luarc.json', '.luarc.jsonc' }, '.git' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
root_markers
doesn't generally go with a mixed list (I am to blame because I copy-pasted the suggestion in #52 without enough care):
root_markers = {
".luarc.json",
".luarc.jsonc",
".luacheckrc",
".stylua.toml",
"stylua.toml",
"selene.toml",
"selene.yml",
".git",
},
version = 'LuaJIT', | ||
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To activate the server, you must call vim.lsp.enable()
after configuring:
-- ...
vim.lsp.enable('lua_ls')
Updates Neovim configuration instructions to follow their new config method.
Closes #52