lsp: Pass back diagnostic .data when querying code actions for it (#14962)

Per the LSP spec, we should pass .data field of diagnostics into code
action request:
```
	/**
	 * A data entry field that is preserved between a
	 * `textDocument/publishDiagnostics` notification and
	 * `textDocument/codeAction` request. *
	 * @since 3.16.0 */ data?: LSPAny;
```


Release Notes:

- Fixed rare cases where a code action triggered by diagnostic may not
be available for use.
This commit is contained in:
Piotr Osiewicz 2024-07-22 17:49:11 +02:00 committed by GitHub
parent 10d2353e07
commit 865904a0c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 18 additions and 1 deletions

View file

@ -4595,6 +4595,7 @@ impl Project {
is_primary: true,
is_disk_based,
is_unnecessary,
data: diagnostic.data.clone(),
},
});
if let Some(infos) = &diagnostic.related_information {
@ -4612,6 +4613,7 @@ impl Project {
is_primary: false,
is_disk_based,
is_unnecessary: false,
data: diagnostic.data.clone(),
},
});
}