Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: provide a custom variable for typeCheckingMode #104

Merged
merged 2 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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