Home

Awesome

lsp-pyright

Build Status License MELPA Join the chat at https://gitter.im/emacs-lsp/lsp-mode

<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc -->

Table of Contents

<!-- markdown-toc end -->

lsp-mode client leveraging pyright and basedpyright language server.

Quickstart

(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

Configuration

lsp-pyright supports the following configuration. Each configuration is described in detail in Pyright Settings.

Projects can be further configured using pyrightconfig.json file. For further details please see Pyright Configuration.

Choosing the correct version of Python

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: