Closed tsoernes closed 2 months ago
How about this?
(lsp-register-custom-settings
`((,(concat lsp-pyright-langserver-command ".typeCheckingMode") "off"))
Or use pyrightconfig.json
.
This worked:
(defun disable-pyright-type-errors ()
"Disable type-related errors in Pyright."
(interactive)
(lsp-register-custom-settings
'(("python.analysis.typeCheckingMode" "off")
("basedpyright.analysis.typeCheckingMode" "off")))
(lsp-restart-workspace))
(defun enable-pyright-type-errors ()
"Enable strict type-related errors in Pyright."
(interactive)
(lsp-register-custom-settings
'(("python.analysis.typeCheckingMode" "basic")
("basedpyright.analysis.typeCheckingMode" "basic")))
(lsp-restart-workspace))
(defun enable-standard-pyright-type-errors ()
"Enable strict type-related errors in Pyright."
(interactive)
(lsp-register-custom-settings
'(("python.analysis.typeCheckingMode" "standard")
("basedpyright.analysis.typeCheckingMode" "standard")))
(lsp-restart-workspace))
(defun enable-strict-pyright-type-errors ()
"Enable strict type-related errors in Pyright."
(interactive)
(lsp-register-custom-settings
'(("python.analysis.typeCheckingMode" "strict")
("basedpyright.analysis.typeCheckingMode" "strict")))
(lsp-restart-workspace))
(defun enable-all-pyright-type-errors ()
"Enable strict type-related errors in Pyright."
(interactive)
(lsp-register-custom-settings
'(("python.analysis.typeCheckingMode" "strict")
("basedpyright.analysis.typeCheckingMode" "all")))
(lsp-restart-workspace))
I use the basedpyright fork.
Is there a way to temporarily disable pyright type checking?
Something like this:
However there is no variable
lsp-pyright-typechecking-mode
, however there is atypeCheckingMode
setting for pyright in vscode: https://github.com/microsoft/pyright/blob/main/docs/configuration.md . I have tried this also but no luck: