LSP-basedpyright
Python support for Sublime's LSP plugin provided through DetachHead/basedpyright.
Details
Installs
- Total 464
- Win 173
- Mac 125
- Linux 166
Oct 6 | Oct 5 | Oct 4 | Oct 3 | Oct 2 | Oct 1 | Sep 30 | Sep 29 | Sep 28 | Sep 27 | Sep 26 | Sep 25 | Sep 24 | Sep 23 | Sep 22 | Sep 21 | Sep 20 | Sep 19 | Sep 18 | Sep 17 | Sep 16 | Sep 15 | Sep 14 | Sep 13 | Sep 12 | Sep 11 | Sep 10 | Sep 9 | Sep 8 | Sep 7 | Sep 6 | Sep 5 | Sep 4 | Sep 3 | Sep 2 | Sep 1 | Aug 31 | Aug 30 | Aug 29 | Aug 28 | Aug 27 | Aug 26 | Aug 25 | Aug 24 | Aug 23 | Aug 22 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 1 | 0 | 0 | 0 | 1 | 0 | 6 | 2 | 3 | 3 | 0 | 1 | 1 | 1 | 0 | 3 | 0 | 1 | 4 | 2 | 0 | 1 | 0 | 3 | 1 | 1 | 3 | 1 | 0 | 3 | 2 | 3 | 4 | 1 | 1 | 0 | 1 | 2 | 3 | 1 | 2 | 3 | 3 | 0 | 1 | 0 |
Mac | 0 | 0 | 2 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 1 | 1 |
Linux | 0 | 2 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 2 | 0 | 0 | 1 | 2 | 0 | 1 | 1 | 1 | 2 | 0 | 1 | 0 | 0 | 3 | 0 | 0 | 6 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 | 0 | 0 | 1 | 0 |
Readme
- Source
- raw.githubusercontent.com
LSP-basedpyright
Python support for Sublime's LSP plugin provided through DetachHead/basedpyright, which basically includes all Pyright features and some exclusive Pylance features such as semantic highlighting and inlay hints.
Installation
- Install LSP and LSP-basedpyright 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 basedpyright 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-basedpyright
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-basedpyright
- From the command palette
Preferences: LSP-basedpyright Settings
- Project-specific configuration
From the command palette run
Project: Edit Project
and add your settings in:
{
"settings": {
"LSP": {
"LSP-basedpyright": {
"settings": {
// Put your settings here
}
}
}
}
}
- Various options can only be configured through a
pyrightconfig.json
configuration file (check configuration for more info)
Provided Command Palette commands
Command | Description |
---|---|
LSP-basedpyright: Create Basedpyright 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.