[air] lsp: add pull diagnostics, fix other pulls

We'd only pull markup (such as inlay hints, code lenses, etc.) in
response to the "workspace/*/refresh" notifications, which is what
rust-analyzer sends on every document change, but that's not how it is
supposed to work. By the spec, those notifications should occur whenever
a project-wide change was detected by the server that may have affected
all documents' markup.

The expected behaviour is that the client (Air) requests the changes for
all the markup whenever it thinks it's convenient and warranted. This
translates into requests on any document change.

It wasn't necessary with rust-analyzer, since the original way worked,
but we didn't get any live updates to inlay hints and others when using
different language servers, such as typescript LSP server.

In addition, a dignostic pull was added with the same kind of trigger
(on every document change). This is necessary to support kotlin LSP,
which doesn't ever send textDocument/publishDiagnostic notification.

GitOrigin-RevId: 5df5c2981336fe0fba1cb5e04c6883deef2e9bd6
This commit is contained in:
Ludwig Valda Vasquez
2025-10-07 19:45:53 +00:00
committed by intellij-monorepo-bot
parent b87ae55b2d
commit e38c0dfd62
@@ -279,11 +279,9 @@ data class DocumentDiagnosticParams(
*/
val previousResultId: String? = null,
override val workDoneToken: ProgressToken?,
override val partialResultToken: ProgressToken?,
) : WorkDoneProgressParams, PartialResultParams
override val workDoneToken: ProgressToken? = null,
override val partialResultToken: ProgressToken? = null,
) : WorkDoneProgressParams, PartialResultParams
@Serializable
enum class DocumentDiagnosticReportKind {
@@ -352,5 +350,5 @@ object Diagnostics {
)
val Refresh: RequestType<Unit, Unit, Unit> =
RequestType("textDocument/diagnostics/refresh", Unit.serializer(), Unit.serializer(), Unit.serializer())
RequestType("workspace/diagnostic/refresh", Unit.serializer(), Unit.serializer(), Unit.serializer())
}