ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

LSP-pyright

by sublimelsp ST3

Python support for Sublime's LSP plugin provided through microsoft/pyright.

Details

Installs

  • Total 658
  • Win 258
  • Mac 210
  • Linux 190
Mar 9 Mar 8 Mar 7 Mar 6 Mar 5 Mar 4 Mar 3 Mar 2 Mar 1 Feb 28 Feb 27 Feb 26 Feb 25 Feb 24 Feb 23 Feb 22 Feb 21 Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13 Feb 12 Feb 11 Feb 10 Feb 9 Feb 8 Feb 7 Feb 6 Feb 5 Feb 4 Feb 3 Feb 2 Feb 1 Jan 31 Jan 30 Jan 29 Jan 28 Jan 27 Jan 26 Jan 25 Jan 24 Jan 23
Windows 0 2 1 1 0 1 0 4 1 2 2 2 4 1 7 3 4 1 1 4 5 3 2 2 1 1 1 2 1 8 2 1 0 3 1 2 6 2 0 3 2 2 0 2 1 2
Mac 0 0 2 2 0 2 0 0 1 1 1 1 1 0 1 3 4 1 1 0 0 0 6 2 0 2 2 6 3 5 2 0 1 2 2 1 4 1 1 0 2 4 4 1 1 3
Linux 3 2 1 3 3 2 1 1 2 2 0 0 1 2 2 5 2 0 0 2 0 1 1 1 1 2 3 2 4 2 1 4 4 1 0 2 0 4 1 2 2 1 1 2 0 0

Readme

Source
raw.​githubusercontent.​com

LSP-pyright

Python support for Sublime's LSP plugin provided through microsoft/pyright.

Installation

  1. Make sure you have Node.js installed and node is in your $PATH. The language server subprocess is a Node.js app. The minimum required Node.js version is 12.
  2. Install LSP and LSP-pyright via Package Control.
  3. Restart Sublime.
  4. (Optional) Configure pyright for your virtualenv.

Configuration

TIP: It's recommended to additionally install the LSP-json package which provides validation and auto-complete for LSP-pyright settings and the pyrightconfig.json configuration file.

Here are some ways to configure the package and the language server.

  • From Preferences > Package Settings > LSP > Servers > LSP-pyright
  • From the command palette Preferences: LSP-pyright Settings
  • Project-specific configuration From the command palette run Project: Edit Project and add your settings in:
{
     "settings": {
        "LSP": {
           "LSP-pyright": {
              "settings": {
                 // Put your settings here
              }
           }
        }
     }
  }

Virtual environments

If your project needs to run and be validated within a virtual environment, the pyrightconfig.json file must be present at the root of your project.

This configuration file, at a minimum, should define where your Python virtualenvs are located, as well as the name of the one to use for your project:

{
    "venvPath": "/path/to/virtualenvs/",
    "venv": "myenv"
}

The venv option is only supported in the pyrightconfig.json file. The venvPath option can also be specified in your .sublime-project, in case you don't want to hard-code a system-specific path in a shared project.

Please see Pyright Documentation for more options.