diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2021-05-20 19:56:48 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-20 19:56:48 +1000 |
commit | 014d8d51c0bfb10a8f47544a94d5a2b6cea7b578 (patch) | |
tree | e6967d9317c01cfb7f51990676502d4391f582a4 /cli/tests/integration_tests_lsp.rs | |
parent | bdee065d424f4dcc45c9137ccd1d0d9e581d20ae (diff) |
fix(lsp): re-enable the per resource configuration without a deadlock (#10625)
Fixes #10603
Diffstat (limited to 'cli/tests/integration_tests_lsp.rs')
-rw-r--r-- | cli/tests/integration_tests_lsp.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/cli/tests/integration_tests_lsp.rs b/cli/tests/integration_tests_lsp.rs index 15abfe678..a6d4f2d29 100644 --- a/cli/tests/integration_tests_lsp.rs +++ b/cli/tests/integration_tests_lsp.rs @@ -38,6 +38,13 @@ where client .write_notification("textDocument/didOpen", params) .unwrap(); + + let (id, method, _) = client.read_request::<Value>().unwrap(); + assert_eq!(method, "workspace/configuration"); + client + .write_response(id, json!({ "enable": true })) + .unwrap(); + let (method, _) = client.read_notification::<Value>().unwrap(); assert_eq!(method, "textDocument/publishDiagnostics"); let (method, _) = client.read_notification::<Value>().unwrap(); @@ -209,6 +216,13 @@ fn lsp_hover_disabled() { }), ) .unwrap(); + + let (id, method, _) = client.read_request::<Value>().unwrap(); + assert_eq!(method, "workspace/configuration"); + client + .write_response(id, json!({ "enable": false })) + .unwrap(); + let (maybe_res, maybe_err) = client .write_request( "textDocument/hover", @@ -453,6 +467,12 @@ fn lsp_hover_closed_document() { }), ) .unwrap(); + let (id, method, _) = client.read_request::<Value>().unwrap(); + assert_eq!(method, "workspace/configuration"); + client + .write_response(id, json!({ "enable": true })) + .unwrap(); + client .write_notification( "textDocument/didOpen", @@ -466,6 +486,12 @@ fn lsp_hover_closed_document() { }), ) .unwrap(); + let (id, method, _) = client.read_request::<Value>().unwrap(); + assert_eq!(method, "workspace/configuration"); + client + .write_response(id, json!({ "enable": true })) + .unwrap(); + let (method, _) = client.read_notification::<Value>().unwrap(); assert_eq!(method, "textDocument/publishDiagnostics"); let (method, _) = client.read_notification::<Value>().unwrap(); |