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 332
  • Win 137
  • Mac 104
  • Linux 91
Dec 3 Dec 2 Dec 1 Nov 30 Nov 29 Nov 28 Nov 27 Nov 26 Nov 25 Nov 24 Nov 23 Nov 22 Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1 Oct 31 Oct 30 Oct 29 Oct 28 Oct 27 Oct 26 Oct 25 Oct 24 Oct 23 Oct 22 Oct 21 Oct 20 Oct 19
Windows 1 2 1 3 1 2 0 6 4 3 1 1 0 1 2 1 5 2 1 1 4 1 4 4 3 1 0 3 2 1 0 0 0 1 2 0 3 1 3 1 3 4 0 1 2 0
Mac 3 1 4 6 2 0 2 3 4 0 1 0 0 0 0 1 4 1 0 0 2 0 2 0 5 4 3 0 0 2 1 1 1 0 2 4 1 1 0 1 1 1 3 2 1 2
Linux 2 3 0 1 0 3 2 5 0 2 2 1 2 1 0 5 0 3 1 0 4 0 1 0 1 1 1 0 0 0 2 1 1 0 0 0 1 0 0 2 0 3 11 0 2 2

Readme

Source
raw.​githubusercontent.​com

LSP-pyright

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

Installation

  1. Install LSP and LSP-pyright via Package Control.
  2. Restart Sublime.
  3. (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 needs to be present at the root of your project.

The configuration file, at a minimum, should define where your Python virtualenvs are located and 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 can be moved to other places like project-specific configuration, in case you don't want to hard-code system-specific path in a shared project.

Please see Pyright Documentation for more options.