Skip to content

Commit

Permalink
feat: provide a custom variable for typeCheckingMode (#104)
Browse files Browse the repository at this point in the history
* feat: provide a custom variable for typeCheckingMode

* chore: update docs
  • Loading branch information
kassick authored Oct 11, 2024
1 parent bf27f19 commit 327edce
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
16 changes: 16 additions & 0 deletions lsp-pyright.el
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 327edce

Please sign in to comment.