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
rajive added a commit to rajive/kickstart.nvim that referenced this pull request Jul 4, 2025
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.

Can you remove the formatting changes?

Other that everything looks great 😄

guru245 added a commit to guru245/kickstart.nvim that referenced this pull request Jul 7, 2025
guru245 added a commit to guru245/kickstart.nvim that referenced this pull request Jul 7, 2025
@gozes
Copy link

gozes commented Jul 11, 2025

Just an FYI, I have ported this fixes to my kickstart base config. after adding the loop to call lsp.config load time went to 200ms just on the lspconfig

rajive added a commit to rajive/kickstart.nvim that referenced this pull request Jul 12, 2025
rajive added a commit to rajive/kickstart.nvim that referenced this pull request Jul 12, 2025
rajive added a commit to rajive/kickstart.nvim that referenced this pull request Jul 12, 2025
rajive added a commit to rajive/kickstart.nvim that referenced this pull request Jul 12, 2025
rajive added a commit to rajive/kickstart.nvim that referenced this pull request Jul 12, 2025
rajive added a commit to rajive/kickstart.nvim that referenced this pull request Jul 12, 2025
rajive added a commit to rajive/kickstart.nvim that referenced this pull request Jul 12, 2025
rajive added a commit to rajive/kickstart.nvim that referenced this pull request Jul 12, 2025
rajive added a commit to rajive/kickstart.nvim that referenced this pull request Jul 12, 2025
rajive added a commit to rajive/kickstart.nvim that referenced this pull request Jul 12, 2025
rajive added a commit to rajive/kickstart.nvim that referenced this pull request Jul 12, 2025
rajive added a commit to rajive/kickstart.nvim that referenced this pull request Jul 12, 2025
moktavizen added a commit to moktavizen/dotfiles that referenced this pull request Jul 14, 2025
moktavizen added a commit to moktavizen/dotfiles that referenced this pull request Jul 14, 2025
moktavizen added a commit to moktavizen/dotfiles that referenced this pull request Jul 14, 2025
moktavizen added a commit to moktavizen/dotfiles that referenced this pull request Jul 14, 2025
moktavizen added a commit to moktavizen/dotfiles that referenced this pull request Jul 14, 2025
moktavizen added a commit to moktavizen/dotfiles that referenced this pull request Jul 14, 2025
@theammir
Copy link

Just an FYI, I have ported this fixes to my kickstart base config. after adding the loop to call lsp.config load time went to 200ms just on the lspconfig

It's something I'm experiencing with lots of LSPs installed via Mason with automatic_enable = true. More than half of my startup time goes to enable the LSPs. I wonder why is it so expensive, though.

theammir added a commit to theammir/kickstart.nvim that referenced this pull request Jul 19, 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.

4 participants