Closed KotlinIsland closed 7 months ago
@KotlinIsland What does this even mean? There isn't a default neovim python lsp. This is a local configuration item for your personal neovim. This shouldn't be an issue here.
I had some issues changing my ls from pyright to basedpyright. I am using mason-lspconfig
and only got basedpyright loaded after manually uninstalling the pyright ls with :LspUninstall pyright
.
Somehow nvim always loaded pyright, even if I had no pyright lsp config at all
@benedikt-bartscher Tell me more about your config, are you using a distro like LazyVim? If not, care to share your dotfiles?
I used kickstart.nvim, but there is not much left of it.
Normally, I just need to add a new item to the servers
list here which I did for basedpyright like this:
local servers = {
basedpyright = {...}
}
On next nvim startup, mason starts to install basedpyright
as expected. However, if I open a .py
file, :LspInfo
reveals that only the pyright
lsp is loaded. Even if I drop pyright
from my servers
list.
basedpyright
is only loaded if I manually call setup like this:
require('lspconfig').basedpyright.setup(servers.basedpyright.settings.basedpyright)
and i could only get pyright
disabled with :LspUninstall pyright
@benedikt-bartscher its good that you dropped pyright from your servers list, and yes, to fully do that you would also need to uninstall pyright from the list of mason installed packages . (I normally uninstall from the :Mason menu, thanks for letting me know about the :LspUninstall option though) Basedpyright isn't involved in setting the precedence for which LSP that neovim chooses.
i've never used neovim, i just had a friend who's not a python developer show me what happens when they open a python file, and it seemed to download pyright, ruff, and some other things automatically without him having to configure anything. turns out he was using lazyvim.
the question is where those default tools are defined. i'm completely unfamiliar with vim and its ecosystem so i wouldn't know where to look, or if this is even a valid issue in the first place (maybe he had something else installed that did it?)
@DetachHead LazyVim is like a predefined set of configurations settings that you can use out of the box or alter to your needs. The Creator of this distribution added a setting very soon after basedpyright was introduced to neovim. And you can find it here.
I would say that this is not a valid issue here or really anywhere as of right now. This is a configuration setting that must be accounted for and depending on your neovim configuration that might be slightly different from person to person.
thanks, this looks like the answer to my question:
this implies that pyright is the default. if any lazyvim users here want the default changed, they can raise an issue there. but there's nothing to do on our end so i'll just close this issue. i don't think it's my place to barge into their project and demand that they change the default LSP to my one, on a tool that i've never used before lol
Lazyvim defaults to pyright, maybe we could get them to change it to basedpyright