-
-
Notifications
You must be signed in to change notification settings - Fork 156
disable setup LSP #183
Comments
I'm not sure if that's possible as the plugin is closely coupled with nvim-lspconfig. As for the users of your plugin, I think they should just not use it for setting up rust if they want to use rust-tools |
Seems that running nvim-lspconfig inside rust-tools is catching a few people by surprise, myself included. I had a similar problem to #177. It would be great if rust-tools, depending on what it needs internally, had an API that didn't overwrite a user's call to local servers = {
"eslint",
"jsonls",
"rust_analyzer",
"sumneko_lua",
"svelte",
"tsserver",
"yamlls",
}
for _, server in pairs(servers) do
local serverOpts = {
on_attach = on_attach, -- on_attach is defined outside this snippet
}
if server == "rust_analyzer" then
local ok_rt, rust_tools = pcall(require, "rust-tools")
if not ok_rt then
print("Failed to load rust tools, will set up `rust_analyzer` without `rust-tools`.")
else
rust_tools.setup({
server = serverOpts,
})
-- We don't want to call lspconfig.rust_analyzer.setup() when using
-- rust-tools. See
-- * https://github.com/simrat39/rust-tools.nvim/issues/183
-- * https://github.com/simrat39/rust-tools.nvim/issues/177
goto continue
end
end
lspconfig[server].setup(serverOpts)
::continue::
end |
TBH I don't see this changing, we make a lot of changes under the hood to the server options before calling lspconfig, and I think overall its easier for the users to set it up (if you're not calling it in a loop). |
Thanks a lot for your work.
I wrote a plugin
nvim-lsp-setup
wrappingnvim-lspconfig
andnvim-lsp-installer
,I try to integrate
rust-tools
, but rust-tools always setup lsp .Is it possible to add a config to disable it, to setup via installer?
PS: I have read #89
The text was updated successfully, but these errors were encountered: