Skip to content

Commit 327edce

Browse files
authored
feat: provide a custom variable for typeCheckingMode (#104)
* feat: provide a custom variable for typeCheckingMode * chore: update docs
1 parent bf27f19 commit 327edce

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ lsp-mode client leveraging [pyright](https://github.com/microsoft/pyright) and [
3333
`lsp-pyright` supports the following configuration. Each configuration is described in detail in
3434
[Pyright Settings](https://github.com/microsoft/pyright/blob/master/docs/settings.md).
3535

36-
- `pyright.disableLanguageServices` via `lsp-pyright-disable-language-services`
37-
- `pyright.disableOrganizeImports` via `lsp-pyright-disable-organize-imports`
38-
- `pyright.disableTaggedHints` via `lsp-pyright-disable-tagged-hints`
36+
- `basedpyright.` / `pyright.disableLanguageServices` via `lsp-pyright-disable-language-services`
37+
- `basedpyright.` / `pyright.disableOrganizeImports` via `lsp-pyright-disable-organize-imports`
38+
- `basedpyright.` / `pyright.disableTaggedHints` via `lsp-pyright-disable-tagged-hints`
39+
- `basedpyright.` / `python.typeCheckingMode` via `lsp-pyright-type-checking-mode`
3940
- `python.analysis.autoImportCompletions` via `lsp-pyright-auto-import-completions`
4041
- `python.analysis.diagnosticMode` via `lsp-pyright-diagnostic-mode`
4142
- `python.analysis.logLevel` via `lsp-pyright-log-level`

lsp-pyright.el

+16
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,20 @@ If this option is set to \"openFilesOnly\", pyright analyzes only open files."
8080
(const "workspace"))
8181
:group 'lsp-pyright)
8282

83+
(defcustom lsp-pyright-type-checking-mode "standard"
84+
"Specifies the default rule set to use.
85+
86+
\"off\" disables all type-checking rules, but Python syntax and semantic
87+
errors are still reported. \"all\" reports all errors in basedpyright,
88+
but is not supported by pyright. "
89+
:type '(choice
90+
(const :tag "Off" "off")
91+
(const :tag "Basic" "basic")
92+
(const :tag "Standard" "standard")
93+
(const :tag "Strict" "strict")
94+
(const :tag "All (basedpyright only)" "all"))
95+
:group 'lsp-pyright)
96+
8397
(defcustom lsp-pyright-log-level "info"
8498
"Determines the default log level used by pyright.
8599
This can be overridden in the configuration file."
@@ -213,6 +227,8 @@ Current LSP WORKSPACE should be passed in."
213227
`((,(concat lsp-pyright-langserver-command ".disableLanguageServices") lsp-pyright-disable-language-services t)
214228
(,(concat lsp-pyright-langserver-command ".disableOrganizeImports") lsp-pyright-disable-organize-imports t)
215229
(,(concat lsp-pyright-langserver-command ".disableTaggedHints") lsp-pyright-disable-tagged-hints t)
230+
(,(concat lsp-pyright-langserver-command ".typeCheckingMode") lsp-pyright-type-checking-mode)
231+
("python.analysis.typeCheckingMode" lsp-pyright-type-checking-mode)
216232
("python.analysis.autoImportCompletions" lsp-pyright-auto-import-completions t)
217233
("python.analysis.diagnosticMode" lsp-pyright-diagnostic-mode)
218234
("python.analysis.logLevel" lsp-pyright-log-level)

0 commit comments

Comments
 (0)