This is a reapplication of https://github.com/microsoft/pyright/pull/8704 but with also taking into account flags that have to always be set even when a pyrightconfig.json is present because these flags are not settable by a pyrightconfig.json.
I tested vscode-pyright with this change and it takes the diagnostic mode into account correctly now and watches for file changes. This wasn't working with the original submission.
This is a reapplication of https://github.com/microsoft/pyright/pull/8704 but with also taking into account flags that have to always be set even when a pyrightconfig.json is present because these flags are not settable by a pyrightconfig.json.
I tested vscode-pyright with this change and it takes the diagnostic mode into account correctly now and watches for file changes. This wasn't working with the original submission.
Addresses https://github.com/microsoft/pyright/issues/8719