Skip to content

Commit

Permalink
feat: provide custom variable for diagnosticSeverityOverrides (#105)
Browse files Browse the repository at this point in the history
Co-authored-by: Vincent Zhang <[email protected]>
  • Loading branch information
kassick and seagle0128 authored Nov 2, 2024
1 parent cefab98 commit dd54b3a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lsp-pyright.el
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,18 @@ Only available in Emacs 27 and above."
:type 'list
:group 'lsp-pyright)

(defcustom lsp-pyright-diagnostic-severity-overrides '()
"Overrides certain rules severity leve l"
:group 'lsp-pyright
:type `(alist :key-type (string :tag "Rule Name")
:value-type (choice
(const :tag "No Error" "none")
(const :tag "Warning""warning")
(const :tag "Information" "information")
(const :tag "Error" "error")
(const :tag "An error is generated" t)
(const :tag "No error is generated" ,json-false))))

(defcustom lsp-pyright-basedpyright-inlay-hints-variable-types t
"Whether to show inlay hints on assignments to variables.
Expand Down Expand Up @@ -256,6 +268,8 @@ Current LSP WORKSPACE should be passed in."
(,(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)
(,(concat lsp-pyright-langserver-command ".analysis.diagnosticSeverityOverrides") (lambda () (ht-from-alist lsp-pyright-diagnostic-severity-overrides)))
("python.analysis.diagnosticSeverityOverrides" (lambda () (ht-from-alist lsp-pyright-diagnostic-severity-overrides)))
("basedpyright.analysis.inlayHints.variableTypes" lsp-pyright-basedpyright-inlay-hints-variable-types t)
("basedpyright.analysis.inlayHints.callArgumentNames" lsp-pyright-basedpyright-inlay-hints-call-argument-names t)
("basedpyright.analysis.inlayHints.functionReturnTypes" lsp-pyright-basedpyright-inlay-hints-function-return-types t)
Expand Down

0 comments on commit dd54b3a

Please sign in to comment.