Skip to content

feat: add support for new LSP config API in Neovim 0.11+ #1475

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

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

umutondersu
Copy link

@umutondersu umutondersu commented Apr 16, 2025

Summary

  • Added support for the new LSP configuration API introduced in Neovim 0.11+
  • Updated Mason version to v2

@ro0gr
Copy link

ro0gr commented Apr 17, 2025

Kickstart.nvim targets only the latest 'stable' and latest 'nightly' of Neovim.

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.

@umutondersu
Copy link
Author

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 client_supports_method. Depending on the others reaction I would also be in favor of removing it.

@umutondersu
Copy link
Author

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.

@nickgnd
Copy link

nickgnd commented Apr 17, 2025

Hey everyone 👋
I remember a few related conversations that happen lately on this topic, let me share them here

#1458
#1331

I hope they can be useful, cheers ✌️

@umutondersu
Copy link
Author

Hey everyone 👋 I remember a few related conversations that happen lately on this topic, let me share them here

#1458 #1331

I hope they can be useful, cheers ✌️

  • This setup config does not clash with blink.cmp so in that sense It should be okay.
  • I would be able to support this in an ongoing basis
  • I think using the native way would provide a better experience for newbies but that's up to debate

@kaezrr
Copy link
Contributor

kaezrr commented Apr 20, 2025

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

@umutondersu
Copy link
Author

I have removed backwards compatibility and added useful comments for LSPs that still require the old setup

@iton0

This comment was marked as resolved.

@umutondersu
Copy link
Author

Messing around with this and found that this will not respect the lsp_format = "fallback" option in the conform.nvim config. To replicate:

1. comment out the stylua formatter line from conform.nvim config

2. save and reload neovim

3. overindent a line or any other formatting change

4. write file

For me it did not fallback on the lua_ls server for formatting.

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 :ConformInfo It could reveal more info about the issue.

@iton0

This comment has been minimized.

michaellisitsa added a commit to michaellisitsa/dotfiles that referenced this pull request May 5, 2025
@pandar00
Copy link

pandar00 commented May 10, 2025

AFAIK mason-lspconfig setting's handler is a no-op. (PR)
LSP settings are moved to after/lsp/<lang_server_name>.lua (credit; in JP)
lsp-config doc also explains the config is merged with the default.

Note: The merge semantics of configurations follow the behaviour of vim.tbl_deep_extend().

I've been updating my old neovim configs with the latest kickstart but the LSP settings weren't reflected in :LspInfo, but after following the above, LSP correctly reads them

@umutondersu
Copy link
Author

AFAIK mason-lspconfig setting's handler is a no-op. (PR) LSP settings are moved to after/lsp/<lang_server_name>.lua (credit; in JP) lsp-config doc also explains the config is merged with the default.

Note: The merge semantics of configurations follow the behaviour of vim.tbl_deep_extend().

I've been updating my old neovim configs with the latest kickstart but the LSP settings weren't reflected in :LspInfo, but after following the above, LSP correctly reads them

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?

@umutondersu
Copy link
Author

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.

@guru245
Copy link
Contributor

guru245 commented Jun 1, 2025

Hi @spundun ,

Neovim also provides a prebuilt package: AppImage and tarball. We don't have to build Neovim for the distrubution. Please check out this link: https://github.com/neovim/neovim/releases/tag/v0.11.2

@spundun
Copy link

spundun commented Jun 1, 2025

Hi @guru245 , Thanks for the response. That's a cool new thing I learned today :).

The README.md just says "If you are experiencing issues, please make sure you have the latest versions.". Since kickstart puts priority on being new-user-friendly, I'd suggest you add more detailed guidelines there. To many users, "make sure you have the latest version" might just mean making sure you have all the latest software updates from your package manager, especially if you're on the latest version of some standard OS.

Maybe adding detailed instructions along the lines... if nvim --version reports a version lower than the Required version then here are the instructions on how to install it in the user-file-system and set it as your editor before you begin.

nickgnd added a commit to nickgnd/kickstart.nvim that referenced this pull request Jun 3, 2025
149segolte added a commit to 149segolte/nvim that referenced this pull request Jun 4, 2025
brycewalkerdev added a commit to brycewalkerdev/nvim-config that referenced this pull request Jun 13, 2025
cameronr added a commit to cameronr/dotfiles that referenced this pull request Jun 15, 2025
ranger-ross added a commit to ranger-ross/kickstart.nvim that referenced this pull request Jun 29, 2025
@mybuddymichael
Copy link

I spent way too long trying to figure out why inlay hints wouldn't appear anywhere! Turns out my LSP settings weren't even being loaded. I'm super glad I found this PR!

@SetsuikiHyoryu SetsuikiHyoryu mentioned this pull request Jul 1, 2025
1 task
oriori1703 added a commit to oriori1703/kickstart-modular.nvim that referenced this pull request Jul 4, 2025
csahid added a commit to csahid/kickstart.nvim that referenced this pull request Jul 9, 2025
Based on PR nvim-lua#1475 : feat: add support for new LSP config API in Neovim 0.11+
link : nvim-lua#1475
nmosim pushed a commit to nmosim/kickstart-modular.nvim that referenced this pull request Jul 18, 2025
JPHarding added a commit to JPHarding/jph.kickstart.nvim that referenced this pull request Jul 18, 2025
@umutondersu umutondersu requested a review from carloscalla July 19, 2025 21:49
andychi117 added a commit to andychi117/kickstart.nvim that referenced this pull request Jul 22, 2025
andychi117 added a commit to andychi117/kickstart.nvim that referenced this pull request Jul 22, 2025
* Only use pylint as the pylsp's linter.

ref: nvim-lua#1475
nvim-lua#1475
@Ktsierra
Copy link

any updates on this pr? the current implementation of mson-lspconfig doesn't work, handlers was removed in V2.

metamorfoso pushed a commit to metamorfoso/nvim that referenced this pull request Jul 24, 2025
tomasgareau added a commit to tomasgareau/nvim that referenced this pull request Jul 28, 2025
kojdm added a commit to kojdm/kickstart-modular.nvim that referenced this pull request Jul 30, 2025
@logrusx
Copy link

logrusx commented Aug 3, 2025

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 {}),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.json file.

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.

@NaniNoni
Copy link

Is there anything major preventing this from being merged? I merged this patchset into my personal config and everything works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.