ruff
62478c30 - `ruff server`: Support publish diagnostics as a fallback when pull diagnostics aren't supported (#11092)

Commit
1 year ago
`ruff server`: Support publish diagnostics as a fallback when pull diagnostics aren't supported (#11092) ## Summary Fixes #11059 Several major editors don't support [pull diagnostics](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_pullDiagnostics), a method of sending diagnostics to the client that was introduced in version `0.3.17` of the specification. Until now, `ruff server` has only used pull diagnostics, which resulted in diagnostics not being available on Neovim and Helix, which don't support pull diagnostics yet (though Neovim `10.0` will have support for this). `ruff server` will now utilize the older method of sending diagnostics, known as 'publish diagnostics', when pull diagnostics aren't supported by the client. This involves re-linting a document every time it is opened or modified, and then sending the diagnostics generated from that lint to the client via the `textDocument/publishDiagnostics` notification. ## Test Plan The easiest way to test that this PR works is to check if diagnostics show up on Neovim `<=0.9`.
Author
Parents
Loading