microsoft / pylance-release

Documentation and issues for Pylance
Creative Commons Attribution 4.0 International
1.72k stars 766 forks source link

`Add XXX to extraPaths` code action adds path to settings.json even a config file is present #6327

Open StellaHuang95 opened 2 months ago

StellaHuang95 commented 2 months ago

Environment data

Repro Steps

  1. Clone pylance-release
  2. Open pylance-release\testing\single folder in VS Code
  3. Open codeaction.py, place cursor on outerModule
  4. Execute the Add "./outsideLib" to extraPaths code action

    Expected behavior

extraPaths is added to pyrightconfig.json

Actual behavior

extraPaths is added to settings.json

Also, although the warning 'python.analysis.extraPaths' cannot be set... shows up, the diagnostic disappears after executing the code action.

rchiodo commented 2 months ago

I'm pretty sure we already have this one. I remember finding it too.

Yeah this one: https://github.com/microsoft/pylance-release/issues/5195

StellaHuang95 commented 2 months ago

It's slightly different than the other bug. The expected behavior here is that adding to the settings.json shouldn't affect the diagnostics since now the pyrightconfig.json takes precedence?