From 1fd8d092eafc168af779040e93129d14e5a7187d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 16 Oct 2024 20:05:47 +0100 Subject: =?UTF-8?q?Revert=20"feat(lsp):=20"deno/didRefreshDenoConfiguratio?= =?UTF-8?q?nTree"=20notificatio=E2=80=A6=20(#26320)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …ns (#26215)" This reverts commit 06778e4e9b0a856ac39cc01f0813e6076eb150d6 because benchmarks are failing on `main`. --- tests/integration/lsp_tests.rs | 195 ++--------------------------------------- 1 file changed, 5 insertions(+), 190 deletions(-) (limited to 'tests/integration') diff --git a/tests/integration/lsp_tests.rs b/tests/integration/lsp_tests.rs index 85e02041e..0f2d43755 100644 --- a/tests/integration/lsp_tests.rs +++ b/tests/integration/lsp_tests.rs @@ -1049,191 +1049,6 @@ fn lsp_workspace_enable_paths_no_workspace_configuration() { client.shutdown(); } -#[test] -fn lsp_did_refresh_deno_configuration_tree_notification() { - let context = TestContextBuilder::new().use_temp_cwd().build(); - let temp_dir = context.temp_dir(); - temp_dir.create_dir_all("workspace/member1"); - temp_dir.create_dir_all("workspace/member2"); - temp_dir.create_dir_all("non_workspace1"); - temp_dir.create_dir_all("non_workspace2"); - temp_dir.write( - "workspace/deno.json", - json!({ - "workspace": [ - "member1", - "member2", - ], - }) - .to_string(), - ); - temp_dir.write("workspace/member1/deno.json", json!({}).to_string()); - temp_dir.write("workspace/member1/package.json", json!({}).to_string()); - temp_dir.write("workspace/member2/package.json", json!({}).to_string()); - temp_dir.write("non_workspace1/deno.json", json!({}).to_string()); - let mut client = context.new_lsp_command().build(); - client.initialize_default(); - let res = client - .read_notification_with_method::( - "deno/didRefreshDenoConfigurationTree", - ) - .unwrap(); - assert_eq!( - res, - json!({ - "data": [ - { - "scopeUri": temp_dir.url().join("non_workspace1/").unwrap(), - "workspaceRootScopeUri": null, - "denoJson": { - "uri": temp_dir.url().join("non_workspace1/deno.json").unwrap(), - }, - "packageJson": null, - }, - { - "scopeUri": temp_dir.url().join("workspace/").unwrap(), - "workspaceRootScopeUri": null, - "denoJson": { - "uri": temp_dir.url().join("workspace/deno.json").unwrap(), - }, - "packageJson": null, - }, - { - "scopeUri": temp_dir.url().join("workspace/member1/").unwrap(), - "workspaceRootScopeUri": temp_dir.url().join("workspace/").unwrap(), - "denoJson": { - "uri": temp_dir.url().join("workspace/member1/deno.json").unwrap(), - }, - "packageJson": { - "uri": temp_dir.url().join("workspace/member1/package.json").unwrap(), - }, - }, - { - "scopeUri": temp_dir.url().join("workspace/member2/").unwrap(), - "workspaceRootScopeUri": temp_dir.url().join("workspace/").unwrap(), - "denoJson": null, - "packageJson": { - "uri": temp_dir.url().join("workspace/member2/package.json").unwrap(), - }, - }, - ], - }), - ); - temp_dir.write("non_workspace2/deno.json", json!({}).to_string()); - client.did_change_watched_files(json!({ - "changes": [{ - "uri": temp_dir.url().join("non_workspace2/deno.json").unwrap(), - "type": 1, - }], - })); - let res = client - .read_notification_with_method::( - "deno/didRefreshDenoConfigurationTree", - ) - .unwrap(); - assert_eq!( - res, - json!({ - "data": [ - { - "scopeUri": temp_dir.url().join("non_workspace1/").unwrap(), - "workspaceRootScopeUri": null, - "denoJson": { - "uri": temp_dir.url().join("non_workspace1/deno.json").unwrap(), - }, - "packageJson": null, - }, - { - "scopeUri": temp_dir.url().join("non_workspace2/").unwrap(), - "workspaceRootScopeUri": null, - "denoJson": { - "uri": temp_dir.url().join("non_workspace2/deno.json").unwrap(), - }, - "packageJson": null, - }, - { - "scopeUri": temp_dir.url().join("workspace/").unwrap(), - "workspaceRootScopeUri": null, - "denoJson": { - "uri": temp_dir.url().join("workspace/deno.json").unwrap(), - }, - "packageJson": null, - }, - { - "scopeUri": temp_dir.url().join("workspace/member1/").unwrap(), - "workspaceRootScopeUri": temp_dir.url().join("workspace/").unwrap(), - "denoJson": { - "uri": temp_dir.url().join("workspace/member1/deno.json").unwrap(), - }, - "packageJson": { - "uri": temp_dir.url().join("workspace/member1/package.json").unwrap(), - }, - }, - { - "scopeUri": temp_dir.url().join("workspace/member2/").unwrap(), - "workspaceRootScopeUri": temp_dir.url().join("workspace/").unwrap(), - "denoJson": null, - "packageJson": { - "uri": temp_dir.url().join("workspace/member2/package.json").unwrap(), - }, - }, - ], - }), - ); - client.change_configuration(json!({ - "deno": { - "disablePaths": ["non_workspace1"], - }, - })); - let res = client - .read_notification_with_method::( - "deno/didRefreshDenoConfigurationTree", - ) - .unwrap(); - assert_eq!( - res, - json!({ - "data": [ - { - "scopeUri": temp_dir.url().join("non_workspace2/").unwrap(), - "workspaceRootScopeUri": null, - "denoJson": { - "uri": temp_dir.url().join("non_workspace2/deno.json").unwrap(), - }, - "packageJson": null, - }, - { - "scopeUri": temp_dir.url().join("workspace/").unwrap(), - "workspaceRootScopeUri": null, - "denoJson": { - "uri": temp_dir.url().join("workspace/deno.json").unwrap(), - }, - "packageJson": null, - }, - { - "scopeUri": temp_dir.url().join("workspace/member1/").unwrap(), - "workspaceRootScopeUri": temp_dir.url().join("workspace/").unwrap(), - "denoJson": { - "uri": temp_dir.url().join("workspace/member1/deno.json").unwrap(), - }, - "packageJson": { - "uri": temp_dir.url().join("workspace/member1/package.json").unwrap(), - }, - }, - { - "scopeUri": temp_dir.url().join("workspace/member2/").unwrap(), - "workspaceRootScopeUri": temp_dir.url().join("workspace/").unwrap(), - "denoJson": null, - "packageJson": { - "uri": temp_dir.url().join("workspace/member2/package.json").unwrap(), - }, - }, - ], - }), - ); - client.shutdown(); -} - #[test] fn lsp_did_change_deno_configuration_notification() { let context = TestContextBuilder::new().use_temp_cwd().build(); @@ -9588,15 +9403,14 @@ fn lsp_auto_discover_registry() { "triggerCharacter": "@" }), ); - let res = client - .read_notification_with_method::("deno/registryState") - .unwrap(); + let (method, res) = client.read_notification(); + assert_eq!(method, "deno/registryState"); assert_eq!( res, - json!({ + Some(json!({ "origin": "http://localhost:4545", "suggestions": true, - }), + })) ); client.shutdown(); } @@ -10303,6 +10117,7 @@ fn lsp_diagnostics_refresh_dependents() { assert_eq!(json!(diagnostics.all()), json!([])); // no diagnostics now client.shutdown(); + assert_eq!(client.queue_len(), 0); } // Regression test for https://github.com/denoland/deno/issues/10897. -- cgit v1.2.3