LSP-pyright
Python support for Sublime's LSP plugin provided through microsoft/pyright.
Details
Installs
- Total 24K
- Win 10K
- Mac 7K
- Linux 8K
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 | Jan 22 | Jan 21 | Jan 20 | Jan 19 | Jan 18 | Jan 17 | Jan 16 | Jan 15 | Jan 14 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 10 | 12 | 16 | 12 | 6 | 7 | 7 | 12 | 14 | 20 | 7 | 8 | 5 | 12 | 10 | 8 | 16 | 12 | 4 | 10 | 16 | 14 | 17 | 14 | 9 | 12 | 7 | 14 | 12 | 20 | 17 | 13 | 10 | 12 | 10 | 16 | 13 | 9 | 10 | 9 | 15 | 10 | 8 | 12 | 15 |
Mac | 0 | 5 | 5 | 6 | 7 | 2 | 9 | 3 | 6 | 7 | 3 | 7 | 5 | 6 | 5 | 4 | 9 | 8 | 6 | 6 | 5 | 11 | 16 | 10 | 11 | 9 | 6 | 10 | 17 | 12 | 18 | 4 | 11 | 4 | 8 | 7 | 4 | 5 | 7 | 5 | 7 | 3 | 4 | 2 | 4 | 3 |
Linux | 0 | 7 | 11 | 6 | 14 | 9 | 2 | 12 | 4 | 8 | 11 | 7 | 6 | 3 | 7 | 10 | 4 | 8 | 7 | 9 | 8 | 8 | 15 | 12 | 11 | 14 | 4 | 7 | 13 | 11 | 19 | 4 | 7 | 8 | 5 | 7 | 8 | 3 | 9 | 7 | 8 | 7 | 4 | 2 | 7 | 9 |
Readme
- Source
- raw.githubusercontent.com
LSP-pyright
Python support for Sublime's LSP plugin provided through microsoft/pyright.
Installation
- Install LSP and LSP-pyright via Package Control.
- (Optional but recommended) Install the LSP-file-watcher-chokidar via Package Control to enable functionality to notify the server about new files.
- Restart Sublime.
- (Optional) Configure pyright for your
virtualenv
.
The Node.js is required by this server. If
node
is not in your$PATH
, this package will suggest to install a local Node.js runtime automatically. If you instead decide to usenode
that is already installed on your system, make sure that it's at least a version 14.
Configuration
TIP: It's recommended to additionally install the
LSP-json
package which provides validation and auto-complete forLSP-pyright
settings and thepyrightconfig.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
}
}
}
}
}
- Various options can only be configured through a
pyrightconfig.json
configuration file (check Pyright configuration for more info)
Provided Command Palette commands
Command | Description |
---|---|
LSP-pyright: Create Pyright Configuration File |
Creates a pyrightconfig.json file in the root of the project with basic options. Opens the configuration file if it already exists. |
Virtual environments
The plugin attempts to resolve the virtual environment automatically from well-known environment variables and workspace files.
This behavior can be disabled by explicitly setting the python interpreter in the python.pythonPath
setting.
If you want to overwrite the 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"
}
For example, if you have created a virtual environment inside the directory .venv
within the project directory then you would use:
{
"venvPath": ".",
"venv": ".venv"
}
Note that 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.