From 0cd0ed73f062b2cd36e268ba18eb44e54ad1461a Mon Sep 17 00:00:00 2001 From: Rodrigo Kassick Date: Fri, 11 Oct 2024 01:03:31 -0300 Subject: [PATCH 1/2] feat: provide a custom variable for typeCheckingMode --- lsp-pyright.el | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lsp-pyright.el b/lsp-pyright.el index 723fc8d..c61390f 100644 --- a/lsp-pyright.el +++ b/lsp-pyright.el @@ -80,6 +80,20 @@ If this option is set to \"openFilesOnly\", pyright analyzes only open files." (const "workspace")) :group 'lsp-pyright) +(defcustom lsp-pyright-type-checking-mode "standard" + "Specifies the default rule set to use. + +\"off\" disables all type-checking rules, but Python syntax and semantic +errors are still reported. \"all\" reports all errors in basedpyright, +but is not supported by pyright. " + :type '(choice + (const :tag "Off" "off") + (const :tag "Basic" "basic") + (const :tag "Standard" "standard") + (const :tag "Strict" "strict") + (const :tag "All (basedpyright only)" "all")) + :group 'lsp-pyright) + (defcustom lsp-pyright-log-level "info" "Determines the default log level used by pyright. This can be overridden in the configuration file." @@ -213,6 +227,8 @@ Current LSP WORKSPACE should be passed in." `((,(concat lsp-pyright-langserver-command ".disableLanguageServices") lsp-pyright-disable-language-services t) (,(concat lsp-pyright-langserver-command ".disableOrganizeImports") lsp-pyright-disable-organize-imports t) (,(concat lsp-pyright-langserver-command ".disableTaggedHints") lsp-pyright-disable-tagged-hints t) + (,(concat lsp-pyright-langserver-command ".typeCheckingMode") lsp-pyright-type-checking-mode) + ("python.analysis.typeCheckingMode" lsp-pyright-type-checking-mode) ("python.analysis.autoImportCompletions" lsp-pyright-auto-import-completions t) ("python.analysis.diagnosticMode" lsp-pyright-diagnostic-mode) ("python.analysis.logLevel" lsp-pyright-log-level) From 6f013b7425990f79b8cf699cb77273d550b8169e Mon Sep 17 00:00:00 2001 From: Rodrigo Kassick Date: Fri, 11 Oct 2024 10:24:41 -0300 Subject: [PATCH 2/2] chore: update docs --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 56f8cab..a32d11c 100644 --- a/README.md +++ b/README.md @@ -33,9 +33,10 @@ lsp-mode client leveraging [pyright](https://github.com/microsoft/pyright) and [ `lsp-pyright` supports the following configuration. Each configuration is described in detail in [Pyright Settings](https://github.com/microsoft/pyright/blob/master/docs/settings.md). -- `pyright.disableLanguageServices` via `lsp-pyright-disable-language-services` -- `pyright.disableOrganizeImports` via `lsp-pyright-disable-organize-imports` -- `pyright.disableTaggedHints` via `lsp-pyright-disable-tagged-hints` +- `basedpyright.` / `pyright.disableLanguageServices` via `lsp-pyright-disable-language-services` +- `basedpyright.` / `pyright.disableOrganizeImports` via `lsp-pyright-disable-organize-imports` +- `basedpyright.` / `pyright.disableTaggedHints` via `lsp-pyright-disable-tagged-hints` +- `basedpyright.` / `python.typeCheckingMode` via `lsp-pyright-type-checking-mode` - `python.analysis.autoImportCompletions` via `lsp-pyright-auto-import-completions` - `python.analysis.diagnosticMode` via `lsp-pyright-diagnostic-mode` - `python.analysis.logLevel` via `lsp-pyright-log-level`