From c31c93ce70c1147872d911c4a05c808d4078339b Mon Sep 17 00:00:00 2001 From: Nayeem Rahman Date: Tue, 29 Aug 2023 09:43:11 +0100 Subject: fix(lsp): delete test modules with all tests deleted (#20321) Fixes https://github.com/denoland/vscode_deno/issues/899. --- cli/tests/integration/lsp_tests.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'cli/tests') diff --git a/cli/tests/integration/lsp_tests.rs b/cli/tests/integration/lsp_tests.rs index 665fa6275..218b1db40 100644 --- a/cli/tests/integration/lsp_tests.rs +++ b/cli/tests/integration/lsp_tests.rs @@ -8549,6 +8549,32 @@ Deno.test({ _ => panic!("unexpected message {}", json!(notification)), } + // Regression test for https://github.com/denoland/vscode_deno/issues/899. + temp_dir.write("./test.ts", ""); + client.write_notification( + "textDocument/didChange", + json!({ + "textDocument": { + "uri": temp_dir.uri().join("test.ts").unwrap(), + "version": 2 + }, + "contentChanges": [{ "text": "" }], + }), + ); + + assert_eq!(client.read_diagnostics().all().len(), 0); + + let (method, notification) = client.read_notification::(); + assert_eq!(method, "deno/testModuleDelete"); + assert_eq!( + notification, + Some(json!({ + "textDocument": { + "uri": temp_dir.uri().join("test.ts").unwrap() + } + })) + ); + client.shutdown(); } -- cgit v1.2.3