From 71f64fcaa6e354889eec734ce6504b14c10a518a Mon Sep 17 00:00:00 2001 From: Jeremy Kun Date: Wed, 22 Jun 2022 21:51:43 -0700 Subject: [PATCH] Add autopep8.enabled to the schema Added a note that in order to enable yapf, one must disable autopep8. Confirmed with the following config, which reports to the log which formatter is being used when invoking `lua vim.lsp.buf.formatting()` ``` nvim_lsp.pylsp.setup { cmd = { "/.../bin/pylsp", "-v", "--log-file=/tmp/pylsp.log" }, settings = { pylsp = { plugins = { autopep8 = {enabled = false}, }, }, }, } ``` I only noticed this because my yapf config uses 2-space indenting (thanks, Google, for forcing me to do this), and with no configuration changes it will ignore that config in my `setup.cfg`, because autopep8 doesn't see it. --- CONFIGURATION.md | 1 + pylsp/config/schema.json | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CONFIGURATION.md b/CONFIGURATION.md index 9f0df03b..2f0bc535 100644 --- a/CONFIGURATION.md +++ b/CONFIGURATION.md @@ -4,6 +4,7 @@ This server can be configured using `workspace/didChangeConfiguration` method. E | **Configuration Key** | **Type** | **Description** | **Default** |----|----|----|----| | `pylsp.configurationSources` | `array` of unique `string` (one of: `pycodestyle`, `pyflakes`) items | List of configuration sources to use. | `["pycodestyle"]` | +| `pylsp.plugins.autopep8.enabled` | `boolean` | Enable or disable the plugin (disabling required to use `yapf`). | `true` | | `pylsp.plugins.flake8.config` | `string` | Path to the config file that will be the authoritative config source. | `null` | | `pylsp.plugins.flake8.enabled` | `boolean` | Enable or disable the plugin. | `false` | | `pylsp.plugins.flake8.exclude` | `array` of `string` items | List of files or directories to exclude. | `[]` | diff --git a/pylsp/config/schema.json b/pylsp/config/schema.json index 860ccc10..44437807 100644 --- a/pylsp/config/schema.json +++ b/pylsp/config/schema.json @@ -14,6 +14,11 @@ }, "uniqueItems": true }, + "pylsp.plugins.autopep8.enabled": { + "type": "boolean", + "default": true, + "description": "Enable or disable the plugin (disabling required to use `yapf`)." + }, "pylsp.plugins.flake8.config": { "type": ["string", "null"], "default": null,