diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2023-09-24 17:59:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-24 17:59:42 +0100 |
commit | 33f84321b29f97c5757f019a72228c1c9631852e (patch) | |
tree | 97b5d9cb5987010c674fb6743429b2ef14fad633 /test_util/src | |
parent | cb9ab9c3ac53ed642c6c648f4931056551a378b7 (diff) |
refactor(lsp): implement "deno.cacheOnSave" server-side (#20632)
Diffstat (limited to 'test_util/src')
-rw-r--r-- | test_util/src/lsp.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test_util/src/lsp.rs b/test_util/src/lsp.rs index 72d27f6d0..d953c86e7 100644 --- a/test_util/src/lsp.rs +++ b/test_util/src/lsp.rs @@ -748,6 +748,10 @@ impl LspClient { self.write_response(id, result); } + pub fn did_save(&mut self, params: Value) { + self.write_notification("textDocument/didSave", params); + } + pub fn did_change_watched_files(&mut self, params: Value) { self.write_notification("workspace/didChangeWatchedFiles", params); } @@ -760,11 +764,7 @@ impl LspClient { /// Reads the latest diagnostics. It's assumed that pub fn read_diagnostics(&mut self) -> CollectedDiagnostics { - // ask the server what the latest diagnostic batch index is - let latest_diagnostic_batch_index = - self.get_latest_diagnostic_batch_index(); - - // now wait for three (deno, lint, and typescript diagnostics) batch + // wait for three (deno, lint, and typescript diagnostics) batch // notification messages for that index let mut read = 0; let mut total_messages_len = 0; @@ -773,7 +773,7 @@ impl LspClient { self.read_notification::<DiagnosticBatchNotificationParams>(); assert_eq!(method, "deno/internalTestDiagnosticBatch"); let response = response.unwrap(); - if response.batch_index == latest_diagnostic_batch_index { + if response.batch_index == self.get_latest_diagnostic_batch_index() { read += 1; total_messages_len += response.messages_len; } |