DetachHead / basedpyright

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

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

Open mark-henry01 opened 1 month ago

mark-henry01 commented 1 month ago

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 commented 1 month ago

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?

DetachHead commented 1 month ago

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)

mark-henry01 commented 1 month ago

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!