summaryrefslogtreecommitdiff
path: root/cli/lsp/lsp_custom.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/lsp/lsp_custom.rs')
-rw-r--r--cli/lsp/lsp_custom.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/cli/lsp/lsp_custom.rs b/cli/lsp/lsp_custom.rs
index 70a245a66..24c4bc131 100644
--- a/cli/lsp/lsp_custom.rs
+++ b/cli/lsp/lsp_custom.rs
@@ -10,6 +10,8 @@ pub const TASK_REQUEST: &str = "deno/task";
pub const RELOAD_IMPORT_REGISTRIES_REQUEST: &str =
"deno/reloadImportRegistries";
pub const VIRTUAL_TEXT_DOCUMENT: &str = "deno/virtualTextDocument";
+pub const LATEST_DIAGNOSTIC_BATCH_INDEX: &str =
+ "deno/internalLatestDiagnosticBatchIndex";
// While lsp_types supports inlay hints currently, tower_lsp does not.
pub const INLAY_HINT: &str = "textDocument/inlayHint";
@@ -44,3 +46,19 @@ impl lsp::notification::Notification for RegistryStateNotification {
pub struct VirtualTextDocumentParams {
pub text_document: lsp::TextDocumentIdentifier,
}
+
+#[derive(Debug, Deserialize, Serialize)]
+pub struct DiagnosticBatchNotificationParams {
+ pub batch_index: usize,
+ pub messages_len: usize,
+}
+
+/// This notification is only sent for testing purposes
+/// in order to know what the latest diagnostics are.
+pub enum DiagnosticBatchNotification {}
+
+impl lsp::notification::Notification for DiagnosticBatchNotification {
+ type Params = DiagnosticBatchNotificationParams;
+
+ const METHOD: &'static str = "deno/internalTestDiagnosticBatch";
+}