-
Notifications
You must be signed in to change notification settings - Fork 102
feat: Support typeCheckingMode in executionEnvironments #1639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 3 commits
651d1f4
3d078de
0216f47
29b4c8c
260b094
24f2ba6
acf3b9c
88a355b
f47d799
cf00bde
ab295b8
7ba013c
f6352d7
3e6f6de
c604052
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2030,10 +2030,34 @@ export class ConfigOptions { | |
| configExtraPaths: Uri[] | ||
| ): ExecutionEnvironment | undefined { | ||
| try { | ||
| // If typeCheckingMode is specified for this execution environment, | ||
| // use it to generate the base diagnostic rule set. Otherwise, use | ||
| // the config-level diagnostic rule set. | ||
| let baseDiagnosticRuleSet = configDiagnosticRuleSet; | ||
| if (envObj.typeCheckingMode !== undefined) { | ||
DetachHead marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if (typeof envObj.typeCheckingMode === 'string') { | ||
DetachHead marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if ((allTypeCheckingModes as readonly string[]).includes(envObj.typeCheckingMode)) { | ||
|
||
| baseDiagnosticRuleSet = this.constructor.getDiagnosticRuleSet( | ||
| envObj.typeCheckingMode as TypeCheckingMode | ||
| ); | ||
| } else { | ||
| console.error( | ||
| `Config executionEnvironments index ${index}: invalid "typeCheckingMode" value: "${ | ||
| envObj.typeCheckingMode | ||
| }". Expected: ${userFacingOptionsList(allTypeCheckingModes)}` | ||
| ); | ||
| } | ||
| } else { | ||
| console.error( | ||
| `Config executionEnvironments index ${index}: typeCheckingMode must be a string.` | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| const newExecEnv = new ExecutionEnvironment( | ||
| this._getEnvironmentName(), | ||
| configDirUri, | ||
| configDiagnosticRuleSet, | ||
| baseDiagnosticRuleSet, | ||
| configPythonVersion, | ||
| configPythonPlatform, | ||
| configExtraPaths | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.