• Stars
    star
    125
  • Rank 284,669 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created about 4 years ago
  • Updated 26 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

LSP-pyright

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

Installation

  1. Install LSP and LSP-pyright via Package Control.
  2. (Optional but recommended) Install the LSP-file-watcher-chokidar via Package Control to enable functionality to notify the server about new files.
  3. Restart Sublime.
  4. (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 use node 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 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
                }
             }
          }
       }
    }
  • 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.

More Repositories

1

LSP

Client implementation of the Language Server Protocol for Sublime Text
Python
1,630
star
2

LSP-typescript

TypeScript, JavaScript support for Sublime LSP plugin
Python
134
star
3

LSP-intelephense

PHP support for Sublime's LSP plugin provided through intelephense.
Python
93
star
4

LSP-volar

Vue support for Sublime's LSP plugin
Python
84
star
5

LSP-pylsp

Convenience package for the Python Language Server
Shell
71
star
6

LSP-json

Schema validation/completions for your JSON and Sublime files
Python
68
star
7

LSP-rust-analyzer

Convenience package for rust-analyzer
Python
67
star
8

LSP-tailwindcss

Tailwind css support for Sublime's LSP plugin
Python
53
star
9

LSP-gopls

Golang support for Sublime's LSP plugin
Python
48
star
10

LSP-elixir

Elixir support for Sublime LSP plugin
Python
41
star
11

LSP-css

CSS, SCSS, LESS support for Sublime's LSP plugin
JavaScript
37
star
12

LSP-clangd

C/C++ support for Sublime's LSP plugin provided through clangd.
Python
37
star
13

LSP-html

HTML support for Sublime's LSP plugin
JavaScript
33
star
14

LSP-eslint

ESLint support for Sublime LSP plugin
JavaScript
33
star
15

LSP-jdtls

Convenience package for the Eclipse JDT language server
Python
28
star
16

LSP-ruff

LSP helper for ruff - an extremely fast Python linter, written in Rust.
Python
26
star
17

LSP-vue

Vue support for Sublime's LSP plugin
Python
26
star
18

LSP-bash

Bash support for Sublime's LSP plugin provided through bash-language-server.
Python
25
star
19

LSP-lua

Convenience package with a lua language server bundled
Python
24
star
20

LSP-Grammarly

Grammarly support for Sublime's LSP plugin, using the Grammarly language server
Python
24
star
21

LSP-julia

Julia support for Sublime's LSP plugin using LanguageServer.jl
Python
22
star
22

LSP-OmniSharp

Convenience plugin to install/update OmniSharp for LSP
Python
21
star
23

LSP-yaml

YAML support for Sublime's LSP plugin using yaml-language-server
Python
21
star
24

LSP-Dart

Convenience plugin for the Dart Analysis Server, bundled in the Dart SDK
Python
17
star
25

LSP-file-watcher-chokidar

Chokidar-based file watcher implementation for LSP
Python
16
star
26

LSP-TexLab

LaTeX support for Sublime's LSP plugin provided through latex-lsp/texlab.
Python
16
star
27

LSP-svelte

Convenience plugin for Svelte Language Tools
Python
15
star
28

LSP-biome

Biome LSP server for Sublime Text
Python
15
star
29

LSP-marksman

An LSP server for Markdown provided through Marksman.
Python
14
star
30

LSP-dockerfile

Dockerfile support for Sublime's LSP plugin
Python
13
star
31

lsp_utils

Module with LSP-related utilities for Sublime Text
Python
13
star
32

LSP-SourceKit

Convenience plugin for Apple's SourceKit language server
Python
13
star
33

LSP-lemminx

XML support for Sublime's LSP plugin
Python
11
star
34

LSP-Deno

Convenience package for starting the deno lsp server
Python
11
star
35

LSP-terraform

Convenience package for the terraform language server
Python
10
star
36

LSP-SonarLint

Linting from SonarSource
Python
10
star
37

LSP-angular

Convenience plugin for Angular Language Service
Python
9
star
38

LSP-cspell

Spell check support for Sublime's LSP plugin provided through cspell.
JavaScript
9
star
39

LSP-graphql

GraphQL support for Sublime's LSP package
JavaScript
8
star
40

LSP-stylelint

Stylelint support for Sublime's LSP plugin
Shell
7
star
41

LSP-astro

Astro support for Sublime's LSP plugin
Python
7
star
42

LSP-elm

Elm support for Sublime's LSP plugin
Python
7
star
43

repository

Package repository for Package Control
Python
6
star
44

LSP-ltex-ls

Convenience package for the LTeX Language Server (Spell/Grammar check for LaTex and Markdown)
Python
6
star
45

LSP-PowerShellEditorServices

Convenience plugin to install and upgrade the PowerShellEditorServices language server
Python
6
star
46

LSP-basedpyright

Python support for Sublime's LSP plugin provided through DetachHead/basedpyright.
Python
5
star
47

LSP-performance-test

Performance Tests for LSP
Python
4
star
48

LSP-rome

Rome LSP server for Sublime LSP
Python
4
star
49

LSP-cmake

Convenience package for a basic cmake-language-server
Python
3
star
50

LSP-serenata

PHP support for Sublime's LSP plugin using Serenata
Python
2
star
51

LSP-R

Convenience package for the R language server
Python
2
star
52

sublime_asyncio

Python
1
star
53

LSP-flow

Helper package that sets up your flow LSP server automatically
Python
1
star
54

LSP-nimlangserver

A convenience package for the official Nim language server.
Python
1
star
55

LSP-kotlin

Kotlin support for Sublime's LSP package
Python
1
star