summaryrefslogtreecommitdiff
path: root/cli/lsp/client.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/lsp/client.rs')
-rw-r--r--cli/lsp/client.rs34
1 files changed, 34 insertions, 0 deletions
diff --git a/cli/lsp/client.rs b/cli/lsp/client.rs
index 4923a4585..5f1a7fcef 100644
--- a/cli/lsp/client.rs
+++ b/cli/lsp/client.rs
@@ -62,6 +62,20 @@ impl Client {
});
}
+ /// This notification is sent to the client during internal testing
+ /// purposes only in order to let the test client know when the latest
+ /// diagnostics have been published.
+ pub fn send_diagnostic_batch_notification(
+ &self,
+ params: lsp_custom::DiagnosticBatchNotificationParams,
+ ) {
+ // do on a task in case the caller currently is in the lsp lock
+ let client = self.0.clone();
+ spawn(async move {
+ client.send_diagnostic_batch_notification(params).await;
+ });
+ }
+
pub fn send_test_notification(&self, params: TestingNotification) {
// do on a task in case the caller currently is in the lsp lock
let client = self.0.clone();
@@ -160,6 +174,10 @@ trait ClientTrait: Send + Sync {
&self,
params: lsp_custom::RegistryStateNotificationParams,
);
+ async fn send_diagnostic_batch_notification(
+ &self,
+ params: lsp_custom::DiagnosticBatchNotificationParams,
+ );
async fn send_test_notification(&self, params: TestingNotification);
async fn specifier_configurations(
&self,
@@ -197,6 +215,16 @@ impl ClientTrait for TowerClient {
.await
}
+ async fn send_diagnostic_batch_notification(
+ &self,
+ params: lsp_custom::DiagnosticBatchNotificationParams,
+ ) {
+ self
+ .0
+ .send_notification::<lsp_custom::DiagnosticBatchNotification>(params)
+ .await
+ }
+
async fn send_test_notification(&self, notification: TestingNotification) {
match notification {
TestingNotification::Module(params) => {
@@ -311,6 +339,12 @@ impl ClientTrait for ReplClient {
) {
}
+ async fn send_diagnostic_batch_notification(
+ &self,
+ _params: lsp_custom::DiagnosticBatchNotificationParams,
+ ) {
+ }
+
async fn send_test_notification(&self, _params: TestingNotification) {}
async fn specifier_configurations(