Open w0rp opened 3 years ago
Someone nudge me when this is implemented in the actual spec, and I'll support it.
@hsanson They actually did it in the past couple of days! The suggestion I made for a "pull" model for diagnostics instead of a "push" model as an option has been written into the protocol spec. Now we can implement support for it in ALE as the preferred option, so you only see diagnostics in response to an ALE lint cycle.
There's probably an actual server that implements the pull model now I can test against. I pinned this issue so I can try to remember to implement this.
There's probably an actual server that implements the pull model now I can test against.
rust-analyzer has just implemented the pull model, so maybe it could be used for testing if you're going to work on this feature.
What is the bug?
We fix it by implementing the pull model and forcing servers to adapt, plus being careful about when we send document updates.
History
https://github.com/microsoft/vscode/issues/117042
A proposal under review will allow LSP clients to explicitly request diagnostics from language servers, instead of receiving them at random. This will fix issues such as #3555 where you can receive diagnostics due to ALE having to tell servers that changes have been made to files for features like completion to work, even though you don't want them yet.
If/when this proposal is adopted and the protocol is updated, we should implement support for it in ALE so newer versions of servers automatically stop causing this problem for users over time.
Update August 2024: This became part of the Language Server Protocol standard, and now depending on the language server, we can support this in ALE.
Implementation