lsp-mode :heart: pyright
See the codelsp-mode client leveraging pyright and basedpyright language server.
(use-package lsp-pyright
:ensure t
:custom (lsp-pyright-langserver-command "pyright") ;; or basedpyright
:hook (python-mode . (lambda ()
(require 'lsp-pyright)
(lsp)))) ; or lsp-deferred
lsp-pyright supports the following configuration. Each configuration is described in detail in
Pyright Settings.
basedpyright. / pyright.disableLanguageServices via lsp-pyright-disable-language-servicesbasedpyright. / pyright.disableOrganizeImports via lsp-pyright-disable-organize-importsbasedpyright. / pyright.disableTaggedHints via lsp-pyright-disable-tagged-hintsbasedpyright. / python.typeCheckingMode via lsp-pyright-type-checking-modebasedpyright.analysis.inlayHints.variableTypes via lsp-pyright-basedpyright-inlay-hints-variable-typesbasedpyright.analysis.inlayHints.callArgumentNames via lsp-pyright-basedpyright-inlay-hints-call-argument-namesbasedpyright.analysis.inlayHints.functionReturnTypes via lsp-pyright-basedpyright-inlay-hints-function-return-typesbasedpyright.analysis.inlayHints.genericTypes via lsp-pyright-basedpyright-inlay-hints-generic-typespython.analysis.autoImportCompletions via lsp-pyright-auto-import-completionspython.analysis.diagnosticMode via lsp-pyright-diagnostic-modepython.analysis.logLevel via lsp-pyright-log-levelpython.analysis.autoSearchPaths via lsp-pyright-auto-search-pathspython.analysis.extraPaths via lsp-pyright-extra-pathspython.pythonPath via lsp-pyright-locate-pythonpython.venvPath via lsp-pyright-venv-pathProjects can be further configured using pyrightconfig.json file. For further details please see
Pyright Configuration.
lsp-pyright will try its best to select the correct version of the
python executable to use. It will do so by iteratively executing
different search functions, going from most precise to most
general.
The list and order of the list can be modified by customizing
lsp-pyright-python-search-functions. By default the order is:
.venv or venv via lsp-pyright--locate-python-venv.lsp-pyright--locate-python-python.Emacs Lisp
97.3%
Makefile
2.7%
lsp-mode :heart: pyright
See the codelsp-mode client leveraging pyright and basedpyright language server.
(use-package lsp-pyright
:ensure t
:custom (lsp-pyright-langserver-command "pyright") ;; or basedpyright
:hook (python-mode . (lambda ()
(require 'lsp-pyright)
(lsp)))) ; or lsp-deferred
lsp-pyright supports the following configuration. Each configuration is described in detail in
Pyright Settings.
basedpyright. / pyright.disableLanguageServices via lsp-pyright-disable-language-servicesbasedpyright. / pyright.disableOrganizeImports via lsp-pyright-disable-organize-importsbasedpyright. / pyright.disableTaggedHints via lsp-pyright-disable-tagged-hintsbasedpyright. / python.typeCheckingMode via lsp-pyright-type-checking-modebasedpyright.analysis.inlayHints.variableTypes via lsp-pyright-basedpyright-inlay-hints-variable-typesbasedpyright.analysis.inlayHints.callArgumentNames via lsp-pyright-basedpyright-inlay-hints-call-argument-namesbasedpyright.analysis.inlayHints.functionReturnTypes via lsp-pyright-basedpyright-inlay-hints-function-return-typesbasedpyright.analysis.inlayHints.genericTypes via lsp-pyright-basedpyright-inlay-hints-generic-typespython.analysis.autoImportCompletions via lsp-pyright-auto-import-completionspython.analysis.diagnosticMode via lsp-pyright-diagnostic-modepython.analysis.logLevel via lsp-pyright-log-levelpython.analysis.autoSearchPaths via lsp-pyright-auto-search-pathspython.analysis.extraPaths via lsp-pyright-extra-pathspython.pythonPath via lsp-pyright-locate-pythonpython.venvPath via lsp-pyright-venv-pathProjects can be further configured using pyrightconfig.json file. For further details please see
Pyright Configuration.
lsp-pyright will try its best to select the correct version of the
python executable to use. It will do so by iteratively executing
different search functions, going from most precise to most
general.
The list and order of the list can be modified by customizing
lsp-pyright-python-search-functions. By default the order is:
.venv or venv via lsp-pyright--locate-python-venv.lsp-pyright--locate-python-python.Emacs Lisp
97.3%
Makefile
2.7%