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.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. **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': case 'error':
diagnostic = this._addError(message, textRange); diagnostic = this._addError(message, textRange);
break; break;
case 'warning': case 'warning':
diagnostic = this._addWarning(message, textRange); diagnostic = this._addWarning(message, textRange);
break; break;
case 'information': case 'information':
diagnostic = this._addInformation(message, textRange); diagnostic = this._addInformation(message, textRange);
break; break;
case 'none': case 'none':
break; break;
default: default:
return assertNever(diagLevel, `${diagLevel} is not expected`); return assertNever(diagLevel, `${diagLevel} is not expected`);
} }

View File

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

View File

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

View File

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

View File

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