Added "verboseOutput" config setting, allowing verbose logs to be enabled when used with VS Code extension.

This commit is contained in:
Eric Traut 2020-03-01 16:37:05 -08:00
parent 4db6a27358
commit 909f3e6408
3 changed files with 21 additions and 2 deletions

View File

@ -346,6 +346,12 @@
],
"pattern": "^(.*)$"
},
"verboseOutput": {
"$id": "#/properties/verboseOutput",
"type": "boolean",
"title": "Output verbose logging",
"default": "false"
},
"executionEnvironments": {
"$id": "#/properties/executionEnvironments",
"type": "array",

View File

@ -22,6 +22,8 @@ Relative paths specified within the config file are relative to the config file
**venv** [string, optional]: Used in conjunction with the venvPath, specifies the virtual environment to use. Individual execution environments may override this setting.
**verboseOutput** [boolean]: Specifies whether output logs should be verbose. This is useful when diagnosing certain problems like import resolution issues.
**pythonVersion** [string, optional]: Specifies the version of Python that will be used to execute the source code. The version should be specified as a string in the format "M.m" where M is the major version and m is the minor (e.g. `"3.0"` or `"3.6"`). If a version is provided, pyright will generate errors if the source code makes use of language features that are not supported in that version. It will also tailor its use of type stub files, which conditionalizes type definitions based on the version.
**pythonPlatform** [string, optional]: Specifies the target platform that will be used to execute the source code. Should be one of `"Windows"`, `"Darwin"` or `"Linux"`. If specified, pyright will tailor its use of type stub files, which conditionalize type definitions based on the platform.

View File

@ -801,7 +801,7 @@ export class ConfigOptions {
}
}
// Read the "typeshedPath".
// Read the "typeshedPath" setting.
this.typeshedPath = undefined;
if (configObj.typeshedPath !== undefined) {
if (typeof configObj.typeshedPath !== 'string') {
@ -813,7 +813,7 @@ export class ConfigOptions {
}
}
// Read the "typingsPath".
// Read the "typingsPath" setting.
this.typingsPath = undefined;
if (configObj.typingsPath !== undefined) {
if (typeof configObj.typingsPath !== 'string') {
@ -823,6 +823,17 @@ export class ConfigOptions {
}
}
// Read the "verboseOutput" setting.
// Don't initialize to a default value because we want the command-line "verbose"
// switch to apply if this setting isn't specified in the config file.
if (configObj.verboseOutput !== undefined) {
if (typeof configObj.verboseOutput !== 'boolean') {
console.log(`Config "verboseOutput" field must be true or false.`);
} else {
this.verboseOutput = configObj.verboseOutput;
}
}
// Read the "executionEnvironments" array. This should be done at the end
// after we've established default values.
this.executionEnvironments = [];