Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
seagle0128 authored Nov 2, 2024
2 parents 7aad4c3 + cefab98 commit 57b3721
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ lsp-mode client leveraging [pyright](https://github.com/microsoft/pyright) and [
- `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`
- `basedpyright.analysis.inlayHints.variableTypes` via `lsp-pyright-basedpyright-inlay-hints-variable-types`
- `basedpyright.analysis.inlayHints.callArgumentNames` via `lsp-pyright-basedpyright-inlay-hints-call-argument-names`
- `basedpyright.analysis.inlayHints.functionReturnTypes` via `lsp-pyright-basedpyright-inlay-hints-function-return-types`
- `basedpyright.analysis.inlayHints.genericTypes` via `lsp-pyright-basedpyright-inlay-hints-generic-types`
- `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
32 changes: 32 additions & 0 deletions lsp-pyright.el
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,34 @@ Only available in Emacs 27 and above."
(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.
Basedpyright only."
:type 'boolean
:group 'lsp-pyright)

(defcustom lsp-pyright-basedpyright-inlay-hints-call-argument-names t
"Whether to show inlay hints on function arguments.
Basedpyright only."
:type 'boolean
:group 'lsp-pyright)

(defcustom lsp-pyright-basedpyright-inlay-hints-function-return-types t
"Whether to show inlay hints on function return types.
Basedpyright only."
:type 'boolean
:group 'lsp-pyright)

(defcustom lsp-pyright-basedpyright-inlay-hints-generic-types nil
"Whether to show inlay hints on inferred generic types.
Basedpyright only."
:type 'boolean
:group 'lsp-pyright)

(defun lsp-pyright--locate-venv ()
"Look for virtual environments local to the workspace."
(or lsp-pyright-venv-path
Expand Down Expand Up @@ -242,6 +270,10 @@ Current LSP WORKSPACE should be passed in."
(,(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)
("basedpyright.analysis.inlayHints.genericTypes" lsp-pyright-basedpyright-inlay-hints-generic-types t)
("python.analysis.typeCheckingMode" lsp-pyright-type-checking-mode)
("python.analysis.autoImportCompletions" lsp-pyright-auto-import-completions t)
("python.analysis.diagnosticMode" lsp-pyright-diagnostic-mode)
Expand Down

0 comments on commit 57b3721

Please sign in to comment.