microsoft / pyright

Static Type Checker for Python
Other
13.32k stars 1.45k forks source link

`diagnosticMode` is no longer defaulting to "openFilesOnly" #8719

Closed erictraut closed 2 months ago

erictraut commented 2 months ago

With the latest changes in "main", I noticed that the diagnosticMode setting is no longer defaulting to "openFilesOnly". The Pyright VS Code extension is now analyzing all of the files in my projects.

erictraut commented 2 months ago

@rchiodo, looks like this is fallout from your settings change. Do you have time to look into this today, or should I?

erictraut commented 2 months ago

@rchiodo, it looks like this affects more than just diagnosticMode. A bunch of functionality is broken in the VS Code extension for pyright. It's pretty much unusable currently. I'm going to revert your change for now.

rchiodo commented 2 months ago

I can look now. Was OOF for a bit.

rchiodo commented 2 months ago

I'm not reproducing. Do you have an example layout? I only see errors for the opened files.

rchiodo commented 2 months ago

Maybe it's a background analysis thing. As the config settings are somehow getting lost when passed to the background thread. I'm running debug bits.

erictraut commented 2 months ago

I'm running debug also. Did you un-revert (i.e. reapply) your commit?

rchiodo commented 2 months ago

Reproing now. Not sure what the problem was.

It seems there are some settings that should always be applied. 'checkOpenFilesOnly' is one of them. I'll need to double check all of the options in 'CommandLineOptions' to make sure they're not one of the json allowed settings.

rchiodo commented 2 months ago

Maybe it would be good to separate the parts of the CommandLineOptions into two sections. 'Json/pyproject.toml' configurable parts and those that are command line only.

erictraut commented 2 months ago

Yeah, sounds reasonable. Maybe move all of the Json/pyproject.toml configurable fields into a sub-structure that hangs off CommandLineOptions?

rchiodo commented 2 months ago

Yeah my thoughts exactly.

erictraut commented 2 months ago

This is addressed in pyright 1.1.376.