From 864330c158b728fbdeec20ffc5a9eff3c0122e34 Mon Sep 17 00:00:00 2001 From: Tanguy Fardet Date: Sun, 11 Aug 2024 22:56:42 +0200 Subject: [PATCH 1/4] Instructions to use Ruff with other servers in Kate --- docs/editors/setup.md | 50 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/docs/editors/setup.md b/docs/editors/setup.md index f554dcb1e05f3..6c9711f310f1a 100644 --- a/docs/editors/setup.md +++ b/docs/editors/setup.md @@ -310,7 +310,55 @@ See [LSP Client documentation](https://docs.kde.org/stable5/en/kate/kate/kate-ap on how to configure the server from there. !!! important - Kate's LSP Client plugin does not support multiple servers for the same language. + Kate's LSP Client plugin does not support multiple servers for the same language! To use Ruff together with another server (e.g. [Jedi](https://jedi.readthedocs.io) to complete the linting with autocompletion and static analysis), please see the instructions below. + +
+Instructions to use Ruff with others servers via pylsp. +
+ +To use Ruff with another server (here Jedi) in Kate, please install pylsp and the Ruff plugin. + +Then, add this to Settings -> Configure Kate -> LSP Client -> User Server Settings: + +```json +{ + "servers": { + "python": { + "command": ["path/to/pylsp", "--check-parent-process"], + "highlightingModeRegex": "^Python$", + "settings": { + "pylsp": { + "plugins": { + "ruff": { + "enabled": true, + "executable": "path/to/ruff" + }, + "autopep8": { + "enabled": false + }, + "flake8": { + "enabled": false + }, + "mccabe": { + "enabled": false + }, + "pycodestyle": { + "enabled": false + }, + "pyflakes": { + "enabled": false + } + } + } + } + } + } +} +``` + +Jedi is enabled by default so there is no need to enable it manually. For more details about the configuration options of pylsp and the other available servers, see the pylsp page and the configuration.md file. +
+ ## Sublime Text From fff6d9f56fc31bf2d6a7a89858004ae447f652fc Mon Sep 17 00:00:00 2001 From: Tanguy Fardet Date: Sun, 11 Aug 2024 23:08:08 +0200 Subject: [PATCH 2/4] Make mdformat happy --- docs/editors/setup.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/editors/setup.md b/docs/editors/setup.md index 6c9711f310f1a..1ec2430d2b5e8 100644 --- a/docs/editors/setup.md +++ b/docs/editors/setup.md @@ -357,6 +357,7 @@ Then, add this to Settings -> Configure Kate -> LSP Client -> User Server ``` Jedi is enabled by default so there is no need to enable it manually. For more details about the configuration options of pylsp and the other available servers, see the pylsp page and the configuration.md file. + From 7af4004b50f87b74c42c2c92e007bdeb3ae92862 Mon Sep 17 00:00:00 2001 From: Dhruv Manilawala Date: Tue, 20 Aug 2024 11:40:02 +0530 Subject: [PATCH 3/4] Expand note for Kate's setup section --- docs/editors/setup.md | 58 ++++++------------------------------------- 1 file changed, 8 insertions(+), 50 deletions(-) diff --git a/docs/editors/setup.md b/docs/editors/setup.md index 1ec2430d2b5e8..23b52798f742d 100644 --- a/docs/editors/setup.md +++ b/docs/editors/setup.md @@ -310,56 +310,14 @@ See [LSP Client documentation](https://docs.kde.org/stable5/en/kate/kate/kate-ap on how to configure the server from there. !!! important - Kate's LSP Client plugin does not support multiple servers for the same language! To use Ruff together with another server (e.g. [Jedi](https://jedi.readthedocs.io) to complete the linting with autocompletion and static analysis), please see the instructions below. - -
-Instructions to use Ruff with others servers via pylsp. -
- -To use Ruff with another server (here Jedi) in Kate, please install pylsp and the Ruff plugin. - -Then, add this to Settings -> Configure Kate -> LSP Client -> User Server Settings: - -```json -{ - "servers": { - "python": { - "command": ["path/to/pylsp", "--check-parent-process"], - "highlightingModeRegex": "^Python$", - "settings": { - "pylsp": { - "plugins": { - "ruff": { - "enabled": true, - "executable": "path/to/ruff" - }, - "autopep8": { - "enabled": false - }, - "flake8": { - "enabled": false - }, - "mccabe": { - "enabled": false - }, - "pycodestyle": { - "enabled": false - }, - "pyflakes": { - "enabled": false - } - } - } - } - } - } -} -``` - -Jedi is enabled by default so there is no need to enable it manually. For more details about the configuration options of pylsp and the other available servers, see the pylsp page and the configuration.md file. - -
- + Kate's LSP Client plugin does not support multiple servers for the same language. As a + workaround, you can use the [python-lsp-server] along with the [python-lsp-ruff] plugin to + use Ruff alongside another language server. Note that this setup won't use the [server + settings](settings.md) because the [python-lsp-ruff] plugin uses the `ruff` executable + and not the language server. + +[python-lsp-server]: https://github.com/python-lsp/python-lsp-server +[python-lsp-ruff]: https://github.com/python-lsp/python-lsp-ruff ## Sublime Text From 24b2945f7ecfedeaed50d9e1de0c74c81b86ae48 Mon Sep 17 00:00:00 2001 From: Dhruv Manilawala Date: Tue, 20 Aug 2024 11:45:56 +0530 Subject: [PATCH 4/4] Update setup.md --- docs/editors/setup.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/docs/editors/setup.md b/docs/editors/setup.md index 23b52798f742d..b09d35a4c566a 100644 --- a/docs/editors/setup.md +++ b/docs/editors/setup.md @@ -311,13 +311,11 @@ on how to configure the server from there. !!! important Kate's LSP Client plugin does not support multiple servers for the same language. As a - workaround, you can use the [python-lsp-server] along with the [python-lsp-ruff] plugin to - use Ruff alongside another language server. Note that this setup won't use the [server - settings](settings.md) because the [python-lsp-ruff] plugin uses the `ruff` executable - and not the language server. - -[python-lsp-server]: https://github.com/python-lsp/python-lsp-server -[python-lsp-ruff]: https://github.com/python-lsp/python-lsp-ruff + workaround, you can use the [`python-lsp-server`](https://github.com/python-lsp/python-lsp-server) + along with the [`python-lsp-ruff`](https://github.com/python-lsp/python-lsp-ruff) plugin to + use Ruff alongside another language server. Note that this setup won't use the [server settings](settings.md) + because the [`python-lsp-ruff`](https://github.com/python-lsp/python-lsp-ruff) plugin uses the + `ruff` executable and not the language server. ## Sublime Text