From cf794e30d54c04b4cbc36232d620a638f40a9d01 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Thu, 18 Jun 2020 21:40:43 -0700 Subject: [PATCH] Added documentation for python.analysis.logLevel setting. --- client/package.json | 53 +++++++++++++++++++------------- docs/settings.md | 2 ++ server/src/languageServerBase.ts | 4 +++ 3 files changed, 38 insertions(+), 21 deletions(-) diff --git a/client/package.json b/client/package.json index 403d375a9..64bd8ef28 100644 --- a/client/package.json +++ b/client/package.json @@ -66,15 +66,6 @@ "type": "object", "title": "Pyright", "properties": { - "python.analysis.typeshedPaths": { - "type": "array", - "default": [], - "items": { - "type": "string" - }, - "description": "Paths to look for typeshed modules.", - "scope": "resource" - }, "python.analysis.autoSearchPaths": { "type": "boolean", "default": true, @@ -106,16 +97,24 @@ "description": "Allows a user to override the severity levels for individual diagnostics.", "scope": "resource" }, - "python.pythonPath": { + "python.analysis.logLevel": { "type": "string", - "default": "python", - "description": "Path to Python, you can use a custom version of Python.", - "scope": "resource" + "default": "info", + "description": "Specifies the level of logging for the Output panel", + "enum": [ + "error", + "warning", + "info", + "trace" + ] }, - "python.venvPath": { - "type": "string", - "default": "", - "description": "Path to folder with a list of Virtual Environments.", + "python.analysis.typeshedPaths": { + "type": "array", + "default": [], + "items": { + "type": "string" + }, + "description": "Paths to look for typeshed modules.", "scope": "resource" }, "pyright.disableLanguageServices": { @@ -130,10 +129,10 @@ "description": "Disables the “Organize Imports” command.", "scope": "resource" }, - "pyright.useLibraryCodeForTypes": { - "type": "boolean", - "default": false, - "description": "Use library implementations to extract type information when type stub is not present.", + "python.pythonPath": { + "type": "string", + "default": "python", + "description": "Path to Python, you can use a custom version of Python.", "scope": "resource" }, "pyright.typeCheckingMode": { @@ -146,6 +145,18 @@ ], "description": "Defines the default rule set for type checking.", "scope": "resource" + }, + "pyright.useLibraryCodeForTypes": { + "type": "boolean", + "default": false, + "description": "Use library implementations to extract type information when type stub is not present.", + "scope": "resource" + }, + "python.venvPath": { + "type": "string", + "default": "", + "description": "Path to folder with a list of Virtual Environments.", + "scope": "resource" } } }, diff --git a/docs/settings.md b/docs/settings.md index 0dd17c21d..e670ab41d 100644 --- a/docs/settings.md +++ b/docs/settings.md @@ -18,6 +18,8 @@ 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.stubPath** [path]: Path to directory containing custom type stub files. **python.analysis.diagnosticMode** ["openFilesOnly", "workspace"]: Determines whether pyright analyzes (and reports errors for) all files in the workspace, as indicated by the config file. If this option is set to "openFilesOnly", pyright analyzes only open files. diff --git a/server/src/languageServerBase.ts b/server/src/languageServerBase.ts index 7ba3c6557..4d1efdf8f 100644 --- a/server/src/languageServerBase.ts +++ b/server/src/languageServerBase.ts @@ -862,12 +862,16 @@ export abstract class LanguageServerBase implements LanguageServerInterface { switch (logLevel.toLowerCase()) { case 'error': return LogLevel.Error; + case 'warning': return LogLevel.Warn; + case 'info': return LogLevel.Info; + case 'trace': return LogLevel.Log; + default: return LogLevel.Info; }