diff options
author | Bartek Iwańczuk <biwanczuk@gmail.com> | 2024-10-16 20:05:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-16 19:05:47 +0000 |
commit | 1fd8d092eafc168af779040e93129d14e5a7187d (patch) | |
tree | 51f8e7310dd94059cf4a4284a24be22965ab7a70 /tests/integration | |
parent | f7dba52133904a9e4ca0468e2c98894992ea2e42 (diff) |
Revert "feat(lsp): "deno/didRefreshDenoConfigurationTree" notificatio… (#26320)
…ns (#26215)"
This reverts commit 06778e4e9b0a856ac39cc01f0813e6076eb150d6 because
benchmarks are failing on `main`.
Diffstat (limited to 'tests/integration')
-rw-r--r-- | tests/integration/lsp_tests.rs | 195 |
1 files changed, 5 insertions, 190 deletions
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 @@ -1050,191 +1050,6 @@ fn lsp_workspace_enable_paths_no_workspace_configuration() { } #[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::<Value>( - "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::<Value>( - "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::<Value>( - "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(); let temp_dir = context.temp_dir(); @@ -9588,15 +9403,14 @@ fn lsp_auto_discover_registry() { "triggerCharacter": "@" }), ); - let res = client - .read_notification_with_method::<Value>("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. |