feat: add support for new LSP config API in Neovim 0.11+#1475
feat: add support for new LSP config API in Neovim 0.11+#1475umutondersu wants to merge 13 commits intonvim-lua:masterfrom
Conversation
Do we really need backward compatibility with Neovim 0 10? I'd consider going with a lighter, happy-path solution. Since the project mainly targets newcomers and servers educational purposes, they'd likely prefer to avoid dealing with legacy approaches. |
|
I think that would be the right approach as well. The reason I intended to maintain backwards compatibility is that some parts of the code is still trying to maintain 0.10 like the |
|
There is also the problem new syntax not supporting all lsp configs. For example tailwindcss requires the old setup. Could be a good idea to delay this until most lsp configs migrate. |
|
Signed-off-by: Umut Sahin Onder <umutsonder@gmail.com>
|
In my opinion, we shouldn't bother with backwards compatibility since Kickstart is mostly aimed at beginners who will download the latest version of Neovim as per the instructions in the repo readme |
|
I have removed backwards compatibility and added useful comments for LSPs that still require the old setup |
This comment was marked as resolved.
This comment was marked as resolved.
I couldn't replicate the issue. I do not think it would be related to these changes as conform.nvim does not use an LSP. In any case If you could check your conform logs by using |
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Rory Hendrickson <35480205+roryhen@users.noreply.github.com>
|
AFAIK
I've been updating my old neovim configs with the latest kickstart but the LSP settings weren't reflected in |
If we were to move LSP configs to their own file, I don't know how mason-tool-installer would work without the servers table maybe by iterating over file names? In your config I see that you still have the servers table. If It is still gonna be preset wouldn't be better to use vim.lsp.config with a loop (like my first hunk) rather than having 2 separate places for LSP servers? |
|
As mentioned in previous conversations, Mason v2 has started introducing a significant delay during startup. For now, I’ve pinned the Mason version to avoid this issue. From my testing, the problem appears to be related to mason-tool-installer; without it, I don’t experience any delays. It would be helpful to hear from someone with more insight into this before proceeding further with Mason v2. |
Based on PR nvim-lua#1475 : feat: add support for new LSP config API in Neovim 0.11+ link : nvim-lua#1475
* Only use pylint as the pylsp's linter. ref: nvim-lua#1475 nvim-lua#1475
|
any updates on this pr? the current implementation of |
Based off this kickstart.nvim PR: nvim-lua/kickstart.nvim#1475
Based on nvim-lua#1475
|
I recommend #1663 over this PR. It states clearly what it does, it does it correctly and stays to the point. This one is actually dealing with mason-lspconfig 2.0, rather than nvim 0.11, does more than it says and pushes authors preferences. |
| ---@type MasonLspconfigSettings | ||
| ---@diagnostic disable-next-line: missing-fields | ||
| require('mason-lspconfig').setup { | ||
| automatic_enable = vim.tbl_keys(servers or {}), |
There was a problem hiding this comment.
Despite that , I still prefer declarativly specifying all the LSPs in the config file, instead of downloading them using the mason interface. This way I can commit those LSPs and have a reproducible setup. This is the same reason I commit the
lazy-lock.jsonfile.
This is unacceptable for plugins that need to set additional settings before the LSP is setup. For one - nvim-java for jdtls. It is also absolutely unnecessary.
Pushing your preferences into a public repository is not very kind to others with different preferences.
I find #1663 better than this one.
|
Is there anything major preventing this from being merged? I merged this patchset into my personal config and everything works fine. |
| -- Installed LSPs are configured and enabled automatically with mason-lspconfig | ||
| -- The loop below is for overriding the default configuration of LSPs with the ones in the servers table | ||
| for server_name, config in pairs(servers) do | ||
| vim.lsp.config(server_name, config) |
There was a problem hiding this comment.
This is the right approach 👍 . Using vim.lsp.config is the only supported approach for Nvim 0.11+.
Nvim 0.11+ should not use require('lspconfig').
nvim-lspconfig will soon be deleting all of its lua/lspconfig/* configs (which have been deprecated for 6+ months) in favor of lsp/*.
….nvim:master This adds support for new LSP configuration API introduced in Neovim 0.11+ and updates Mason to version 2
| -- Installed LSPs are configured and enabled automatically with mason-lspconfig | ||
| -- The loop below is for overriding the default configuration of LSPs with the ones in the servers table | ||
| for server_name, config in pairs(servers) do | ||
| vim.lsp.config(server_name, config) |
There was a problem hiding this comment.
That alone won't do anything. You can't just swap [servername].setup with vim.lsp.config. You should now provide the config in its entirety.
Also you need to enable the server somewhere.
applies patch from nvim-lua#1475 , should be altered to the upstream version when it propagates down to kickstar-modular
|
I just went down a rabbit hole of issues. I initially thought the Is there anything holding this back? There seem to be a few PR's open all attempting to addres the same issue, so I think it's fair to say that it should probably get some priority by now. I'd love for this PR to be merged so it can propagate down to kickstart-modular and eventually my fork. |
This repo is in limbo, perhaps #1627 can clear the situation up for you. |
|
Ah, @yetyetanotherusername thanks for pointing me there. |
applies patch from nvim-lua#1475 , should be altered to the upstream version when it propagates down to kickstar-modular
For the discussion nvim-lua#1475 and for the actual change nvim-lua#1743
Summary