Does it matter which language servers I choose?

I’ve read a lot about what language servers do, but its hard to tell if there are significant differences in quality between them. For instance, is there much difference between Pyright and Ruff for writing Python, or using Marksman or the new Markdown-Oxide LSP for writing markdown?

  1. Why a markdown LSP? Is there anything missing for markdown? Writing
    markdown in neovim just works.

  2. Ruff only provides formatting and linting, it does not provide
    auto-completions. You still need another python LSP for
    auto-completion. I recommend basedpyright over pyright, as the former is
    a fork of pyright, but a real “FOSS”. For Pyright,
    developed by MS and deliberately missing a lot of features to promote their proprietary product pylance, I do not consider it as a real “FOSS”.

I mentioned those Python LSPs for the sake of discussion. I just got Markdown Oxide working for its capabilities in Obsidian vaults and I like it!

Unfortunately there isn’t really a LSP feature compatibility list that gives you features point by point. All the LSP’s kinda handle different things in different ways and some like ruff are lsp’s but they are focused only on the formatting and linting parts of the coding process so no go to definition or things like that. Python’s lsp ecosystem seems to me is particularly fragmented. Your best bet is to just try one until you find something about it that is particularly annoying and see if the others do it.

For myself I’ve basically found different recommendations in reddit and then choose one at random. Then when I found something I didn’t like about it I switched. For example:

I originally was using jedi for python but found that it doesn’t support AutoImporting. Aka when typing a class or function that I have not imported yet it wasn’t adding an import block automatically on completion. Looking at pyright it did have this feature so I switched over to it. But pyright had the downside of being it’s own type checker that is mostly but not completely compatible with mypy (which all the projects I was working with used). So I had to do some custom configuration of pyright to disable type checking if mypy was in my venv.

So all that is to say, there isn’t a clear guide for what LSP is going to be best for your situation. But my personal recommendation is try either pyright or pylsp:

  • Pyright is backed by microsoft so you can be pretty sure it’s not going anywhere any time soon. (basedpyright if you want a “real” FOSS pyright).

  • Pylsp is basically jedi but with a plugin system for adding other tools to cover jedi’s short comings with other tools.

One quick note if you decide to try and switch between jedi and pyright. They have to be configured differently with the lspconfig plugin. Jedi and I assume pylsp options have to be passed in init_options whereas pyright you can pass options in the settings config. I have a little blurb about why til/neovim/lsp-config-settings.md at master · nagibyro/til · GitHub if you’re interested.

Hope this helps!

1 Like