DetachHead / basedpyright

pyright fork with various type checking improvements, improved vscode support and pylance features built into the language server
https://docs.basedpyright.com
Other
1.2k stars 22 forks source link

Get the lazyvim default changed from pyright to basedpyright #258

Closed KotlinIsland closed 7 months ago

KotlinIsland commented 7 months ago

Lazyvim defaults to pyright, maybe we could get them to change it to basedpyright

akthe-at commented 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.

benedikt-bartscher commented 7 months ago

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

akthe-at commented 7 months ago

@benedikt-bartscher Tell me more about your config, are you using a distro like LazyVim? If not, care to share your dotfiles?

benedikt-bartscher commented 7 months ago

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

akthe-at commented 7 months ago

@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.

DetachHead commented 7 months ago

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?)

akthe-at commented 7 months ago

@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.

DetachHead commented 7 months ago

thanks, this looks like the answer to my question:

image

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