diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-05-26 02:10:18 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-26 08:10:18 +0200 |
commit | 25cbd97ab7ef1866e58238f1c28ec0d86062aee8 (patch) | |
tree | d4c8e585f5cc0f8e66598df5be1747aa27ef5a36 /cli/lsp/lsp_custom.rs | |
parent | e95f098ae350f17450d06270ce37032688447f96 (diff) |
chore(lsp/tests): diagnostic synchronization (reland) (#19270)
Merge on approval as it fixes the flaky test.
Diffstat (limited to 'cli/lsp/lsp_custom.rs')
-rw-r--r-- | cli/lsp/lsp_custom.rs | 18 |
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"; +} |