From fc88fa35ff3efc7042556af5b07fa2f5589ac152 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Sat, 17 Dec 2022 16:22:50 -0500 Subject: [PATCH] Add instructions for Sublime Text installation (#1271) --- README.md | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1130d40a9f..c812d475ee 100644 --- a/README.md +++ b/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: + +![](https://user-images.githubusercontent.com/1309177/208266375-331ad8e5-8ac1-4735-bca8-07734eb38536.png) + [`ruffd`](https://github.com/Seamooo/ruffd) is another implementation of the Language Server Protocol (LSP) for Ruff, written in Rust.