-
Notifications
You must be signed in to change notification settings - Fork 29
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
Merge additional config for a language-server? #100
Comments
You'd have to move the whole config.
Pretty much, you can re-run the setup() function vim.schedule(function()
lspconfig.rust_analyzer.setup({
importPrefix = "by_self",
},
cargo = {
loadOutDirsFromCheck = true,
runBuildScripts = true
},
end) This gave me an idea, we could probably export the built-in LSP configs so you can extend them. Basically we can pull out the table (aka object, thanks lua) out of the setup params into a file called I'm not sure I'll have time to work on that anytime soon, but would accept a PR. |
Thanks Luan, I think that did it?!? I had to copy over some dependencies from local lspconfig = require('lspconfig')
local capabilities = vim.lsp.protocol.make_client_capabilities()
local lsp_status = require('lsp-status')
local on_attach = function(client, bufnr)
lsp_status.on_attach(client, bufnr)
require('lsp_signature').on_attach({
debug = false,
handler_opts = {
border = "single",
},
})
end
vim.schedule(function()
lspconfig.rust_analyzer.setup({
capabilities = capabilities,
on_attach = on_attach,
settings = {
["rust-analyzer"] = {
assist = {
importGranularity = "module",
importPrefix = "by_self",
},
cargo = {
loadOutDirsFromCheck = true,
runBuildScripts = true
},
procMacro = {
enable = true
},
},
},
})
end) Thank you! |
Hi!
There's a config option for the
rust_analyzer
language-server that I'd like to add, but I know it's not an appropriate default for everyone.So I'd like to make the change locally. Either for my machine, or just for this one rust workspace, if that's possible.
If I make the change directly to
lua/lang.lua
it looks like this:But of course then I get the warning
How can I "move" this 1-line change into my user settings?
Do I copy all of
lang.lua
into one of thelua/user
files? Can I re-run the language-server'ssetup()
function from one of those? Is there some clever way to just send my 1 extra config option to the language server at run-time or something?Thanks!
The text was updated successfully, but these errors were encountered: