-
Notifications
You must be signed in to change notification settings - Fork 38.3k
feat: improved lsp setup for nvim > 0.11 #1590
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: master
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.
I quite like the idea of teaching how to use servers that were not installed by mason, so I think I prefer this over #1475 (even though it is also great :)
Though I think the formatting changes should be left out of this PR.
Also, I left a couple of suggestions for minor improvements.
Add lua_ls annotations for improved hover experience and replace vim.fn.empty() with vim.tbl_isempty()
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.
Can you remove the formatting changes?
Other that everything looks great 😄
Referring to nvim-lua#1590
Referring to nvim-lua#1590
Just an FYI, I have ported this fixes to my kickstart base config. after adding the loop to call |
It's something I'm experiencing with lots of LSPs installed via Mason with |
I also noticed that, right now loading LSP at -- Main LSP Configuration
'neovim/nvim-lspconfig',
event = 'VeryLazy',
cmd = { 'LspInfo', 'LspInstall', 'LspUninstall' }, |
Works great! Do you want to open a PR maybe? Or is it a temporary solution that shouldn't really belong? |
Overal I like the idea of separating the mason and other servers. However this PR is dealing with mason-lspconfig 2.0 rather than nvim 0.11 and it does more than it says. The idea of separating mason and other servers may be a subject of another PR. I recommend #1663 over this one as it does exactly what it says and does it correctly. |
|
||
-- Enable the following language servers | ||
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed. | ||
-- NOTE: The following line is now commented as blink.cmp extends capabilites by default from its internal code: |
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.
In this case, don't you need to put:
{ 'saghen/blink.cmp', opts = {} },
in the dependencies
for the capabilities to get populated?
Unfortunately, this only seems to work if the LSP servers are already installed and configured. I tried this with a fresh |
I manually patched this change into my modular kickstart config and it seems to fix the issue I was having with my configs for LSPs not propagating. I was also wondering how to install non-mason LSPs. This PR addresses both my questions, thank you! |
…h mason-lspconfig 2.0 and nvim >0.1 that was causing my LSP config not to propogate to the LSP
The aim of this change is to provide a much clearer distinction between how servers are installed & configured (either directly via Mason or manually). This is a slight alternative to this excellent PR for LSP configuration for neovim > 0.11 onwards.
Since the new
mason-lspconfig
changes enable all servers installed via Mason by default, this might cause confusion for newcomers around server enable if they had a language server installed manually but wanted to re-use the defaultnvim-lspconfig
configs.Furthermore, not all language servers might be available on Mason for download - however they might already have default configs available on
nvim-lspconfig
for re-use (example) or have neither available on Mason andnvim-lspconfig
.I'm hoping another benefit of this change is that it should also aid in reducing burden on the mason & nvim-lspconfig maintainers when it comes to answering these specific kind of lsp questions.
As always, I'm open to any feedback here. I'm not too fussed if the above linked PR gets merged over this, but wanted to float this idea by the maintainers and community to gather any & all feedback.
Cheers! 🙂
Minor Changes: