Changed python.analysis.logLevel to use "Information" rather than "Info" for consistency with Python extension.

This commit is contained in:
Eric Traut 2020-09-14 14:44:18 -07:00
parent e2a7247c61
commit 006f5d60d1
6 changed files with 17 additions and 6 deletions

View File

@ -20,7 +20,7 @@ The Pyright VS Code extension honors the following settings.
**python.analysis.extraPaths** [array of paths]: Paths to add to the default execution environment extra paths if there are no execution environments defined in the config file.
**python.analysis.logLevel** ["Error", "Warning", "Info", or "Trace"]: Level of logging for Output panel. The default value for this option is "Info".
**python.analysis.logLevel** ["Error", "Warning", "Information", or "Trace"]: Level of logging for Output panel. The default value for this option is "Information".
**python.analysis.stubPath** [path]: Path to directory containing custom type stub files.

View File

@ -2672,14 +2672,18 @@ export class Binder extends ParseTreeWalker {
case 'error':
diagnostic = this._addError(message, textRange);
break;
case 'warning':
diagnostic = this._addWarning(message, textRange);
break;
case 'information':
diagnostic = this._addInformation(message, textRange);
break;
case 'none':
break;
default:
return assertNever(diagLevel, `${diagLevel} is not expected`);
}

View File

@ -132,13 +132,17 @@ function _parseDiagLevel(value: string): DiagnosticLevel | undefined {
case 'false':
case 'none':
return 'none';
case 'true':
case 'error':
return 'error';
case 'warning':
return 'warning';
case 'information':
return 'information';
default:
return undefined;
}

View File

@ -25,10 +25,13 @@ export function convertLevelToCategory(level: DiagnosticLevel) {
switch (level) {
case 'error':
return DiagnosticCategory.Error;
case 'warning':
return DiagnosticCategory.Warning;
case 'information':
return DiagnosticCategory.Information;
default:
throw new Error(`${level} is not expected`);
}

View File

@ -1049,19 +1049,19 @@ export abstract class LanguageServerBase implements LanguageServerInterface {
return completions?.completionList;
}
protected convertLogLevel(logLevel?: string): LogLevel {
if (!logLevel) {
protected convertLogLevel(logLevelValue?: string): LogLevel {
if (!logLevelValue) {
return LogLevel.Info;
}
switch (logLevel.toLowerCase()) {
switch (logLevelValue.toLowerCase()) {
case 'error':
return LogLevel.Error;
case 'warning':
return LogLevel.Warn;
case 'info':
case 'information':
return LogLevel.Info;
case 'trace':

View File

@ -576,7 +576,7 @@
"enum": [
"Error",
"Warning",
"Info",
"Information",
"Trace"
]
},