Commit 447e35e
committed
fix: async LSP bails on no result
There was an inconsistency between the sync and async version of
lsp_format:
* Sync version invokes all LSP clients even if they don't return a
result, as long as they don't return an error.
* Async version stops as soon as no result is returned.
An example of this happening is when both pylsp and ruff are enabled,
and pylsp only being used for refactoring and mypy, with the isort and
black plugins disabled. In that case, pylsp gets tried first, returns no
result, and conform doesn't even try ruff. It's fine with
`format_on_save` (provided the formatting is fast enough), but
`format_after_save` is unusable.
This commit fixes it by making the async/sync behaviour consistent.1 parent 619363c commit 447e35e
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
129 | | - | |
| 128 | + | |
| 129 | + | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
139 | 141 | | |
140 | 142 | | |
141 | 143 | | |
| |||
0 commit comments