mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 12:54:48 +00:00
Add instructions for Sublime Text installation (#1271)
This commit is contained in:
parent
a2806eb8ef
commit
fc88fa35ff
1 changed files with 51 additions and 2 deletions
53
README.md
53
README.md
|
@ -946,8 +946,11 @@ installable via [PyPI](https://pypi.org/project/python-lsp-ruff/):
|
|||
pip install python-lsp-server python-lsp-ruff
|
||||
```
|
||||
|
||||
The LSP server can be used with any editor that supports the Language Server Protocol. For example,
|
||||
to use it with Neovim, you would add something like the following to your `init.lua`:
|
||||
The LSP server can be used with any editor that supports the Language Server Protocol, including
|
||||
Neovim, Emacs, Sublime Text, etc.
|
||||
|
||||
For example, to use `python-lsp-ruff` with Neovim, add something like the following to your
|
||||
`init.lua`:
|
||||
|
||||
```lua
|
||||
require'lspconfig'.pylsp.setup {
|
||||
|
@ -956,6 +959,15 @@ require'lspconfig'.pylsp.setup {
|
|||
plugins = {
|
||||
ruff = {
|
||||
enabled = true
|
||||
},
|
||||
pycodestyle = {
|
||||
enabled = false
|
||||
},
|
||||
pyflakes = {
|
||||
enabled = false
|
||||
},
|
||||
mccabe = {
|
||||
enabled = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -963,6 +975,43 @@ require'lspconfig'.pylsp.setup {
|
|||
}
|
||||
```
|
||||
|
||||
To use `python-lsp-ruff` with Sublime Text, install Sublime Text's [LSP](https://github.com/sublimelsp/LSP)
|
||||
package, then add something like the following to `LSP.sublime-settings`:
|
||||
|
||||
```json
|
||||
{
|
||||
"clients": {
|
||||
"python-lsp-server": {
|
||||
"command": ["pylsp"],
|
||||
"enabled": true,
|
||||
"selector": "source.python",
|
||||
"settings": {
|
||||
"pylsp": {
|
||||
"plugins": {
|
||||
"pycodestyle": {
|
||||
"enabled": false
|
||||
},
|
||||
"pyflakes": {
|
||||
"enabled": false
|
||||
},
|
||||
"mccabe": {
|
||||
"enabled": false
|
||||
},
|
||||
"ruff": {
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Upon successful installation, you should see errors surfaced directly in your editor:
|
||||
|
||||

|
||||
|
||||
[`ruffd`](https://github.com/Seamooo/ruffd) is another implementation of the Language Server
|
||||
Protocol (LSP) for Ruff, written in Rust.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue