Skip to content

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

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

Conversation

kartikvashistha
Copy link

@kartikvashistha kartikvashistha commented Jun 7, 2025

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 default nvim-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 and nvim-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:

  • Commented and preserved the capabilities step for educational purposes only;
  • Auto formatter might have formatted some code, which I quite like tbh . Happy to revert it if needed.

Copy link
Contributor

@oriori1703 oriori1703 left a 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()
umutondersu added a commit to umutondersu/nvim that referenced this pull request Jun 12, 2025
umutondersu added a commit to umutondersu/nvim that referenced this pull request Jun 12, 2025
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.

2 participants