basedpyright icon indicating copy to clipboard operation
basedpyright copied to clipboard

support configuration with `python` as well as `basedpyright` / deprecate support for having both pylance and basedpyright installed

Open mark-henry01 opened this issue 1 year ago • 4 comments

Hi, with original pyright I am able to get LSP workspace diagnostics and error reporting for the whole project by following config:

{
...
        settings = {
          python = {
            analysis = {
              autoSearchPaths = true,
              diagnosticMode = "workspace",
              useLibraryCodeForTypes = true
            }
          }
        },
}

(My current IDE is Neovim.)

With Basedpyright though it seems, only errors of already opened files are shown. I would have expected this behavior for diagnosticMode = "openFilesOnly" (see also this template config), but explicit have set diagnosticMode = "workspace".

Is there something different I need to do in Basedpyright? Thanks for this great project!

mark-henry01 avatar May 29 '24 16:05 mark-henry01

Funny, sometimes you notice things directly after having opened an issue. This worked for me:

        settings = {
          basedpyright = {
            analysis = {
              autoSearchPaths = true,
              diagnosticMode = "workspace",
              useLibraryCodeForTypes = true
            }
          }
        },

Note basedpyright instead of python.


As an afterthought: What do you think of easing up migration from pyright to basedpyright?

  • Alias pyright-langserver to basedpyright-langserver
  • Alias configuration setting python = {...} to basedpyright = {...}

mark-henry01 avatar May 29 '24 16:05 mark-henry01

originally i renamed python to basedpyright to avoid issues if the user happens to have both pylance and basedpyright installed in vscode. however that was before we started re-implementing pylance features. when more pylance features are added to basedpyright in the future, we should probably stop supporting this use case, and just alias python to basedpyright like you suggested. (see here for more info)

DetachHead avatar May 29 '24 21:05 DetachHead

Oh, didn't have in mind there are users running both extensions at the same time. (Also it seems kinda weird that pylance does not have its own setting namespace, which optionally might alias from python as well - but that is a pylance thing).

Hence your plan sounds reasonable. Thanks again for your efforts!

mark-henry01 avatar May 30 '24 11:05 mark-henry01

i haven't documented it anywhere yet, but this is now supported

DetachHead avatar May 11 '25 07:05 DetachHead