summaryrefslogtreecommitdiff
path: root/cli/bench
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2024-10-16 22:43:26 +0100
committerGitHub <noreply@github.com>2024-10-16 22:43:26 +0100
commit72dd74d83a89d3db17e6ed5d0b8c7f4ba3f3d233 (patch)
treec2344262cbfdb824eacd712744cc805c6e96321c /cli/bench
parentf8417224eb9cbc2e4ae134ae197670a0bc53df2e (diff)
Reland feat(lsp): deno/didRefreshDenoConfigurationTree notifications (#26325)
Diffstat (limited to 'cli/bench')
-rw-r--r--cli/bench/lsp.rs16
-rw-r--r--cli/bench/lsp_bench_standalone.rs4
2 files changed, 20 insertions, 0 deletions
diff --git a/cli/bench/lsp.rs b/cli/bench/lsp.rs
index b088865c6..7baaffca7 100644
--- a/cli/bench/lsp.rs
+++ b/cli/bench/lsp.rs
@@ -150,7 +150,11 @@ fn bench_big_file_edits(deno_exe: &Path) -> Duration {
.deno_exe(deno_exe)
.build();
client.initialize_default();
+ let (method, _): (String, Option<Value>) = client.read_notification();
+ assert_eq!(method, "deno/didRefreshDenoConfigurationTree");
client.change_configuration(json!({ "deno": { "enable": true } }));
+ let (method, _): (String, Option<Value>) = client.read_notification();
+ assert_eq!(method, "deno/didRefreshDenoConfigurationTree");
client.write_notification(
"textDocument/didOpen",
@@ -206,6 +210,8 @@ fn bench_code_lens(deno_exe: &Path) -> Duration {
.deno_exe(deno_exe)
.build();
client.initialize_default();
+ let (method, _): (String, Option<Value>) = client.read_notification();
+ assert_eq!(method, "deno/didRefreshDenoConfigurationTree");
client.change_configuration(json!({ "deno": {
"enable": true,
"codeLens": {
@@ -214,6 +220,8 @@ fn bench_code_lens(deno_exe: &Path) -> Duration {
"test": true,
},
} }));
+ let (method, _): (String, Option<Value>) = client.read_notification();
+ assert_eq!(method, "deno/didRefreshDenoConfigurationTree");
client.write_notification(
"textDocument/didOpen",
@@ -257,7 +265,11 @@ fn bench_find_replace(deno_exe: &Path) -> Duration {
.deno_exe(deno_exe)
.build();
client.initialize_default();
+ let (method, _): (String, Option<Value>) = client.read_notification();
+ assert_eq!(method, "deno/didRefreshDenoConfigurationTree");
client.change_configuration(json!({ "deno": { "enable": true } }));
+ let (method, _): (String, Option<Value>) = client.read_notification();
+ assert_eq!(method, "deno/didRefreshDenoConfigurationTree");
for i in 0..10 {
client.write_notification(
@@ -341,7 +353,11 @@ fn bench_startup_shutdown(deno_exe: &Path) -> Duration {
.deno_exe(deno_exe)
.build();
client.initialize_default();
+ let (method, _): (String, Option<Value>) = client.read_notification();
+ assert_eq!(method, "deno/didRefreshDenoConfigurationTree");
client.change_configuration(json!({ "deno": { "enable": true } }));
+ let (method, _): (String, Option<Value>) = client.read_notification();
+ assert_eq!(method, "deno/didRefreshDenoConfigurationTree");
client.write_notification(
"textDocument/didOpen",
diff --git a/cli/bench/lsp_bench_standalone.rs b/cli/bench/lsp_bench_standalone.rs
index 9c4f264ec..3c946cfbe 100644
--- a/cli/bench/lsp_bench_standalone.rs
+++ b/cli/bench/lsp_bench_standalone.rs
@@ -13,7 +13,11 @@ use test_util::lsp::LspClientBuilder;
fn incremental_change_wait(bench: &mut Bencher) {
let mut client = LspClientBuilder::new().use_diagnostic_sync(false).build();
client.initialize_default();
+ let (method, _): (String, Option<Value>) = client.read_notification();
+ assert_eq!(method, "deno/didRefreshDenoConfigurationTree");
client.change_configuration(json!({ "deno": { "enable": true } }));
+ let (method, _): (String, Option<Value>) = client.read_notification();
+ assert_eq!(method, "deno/didRefreshDenoConfigurationTree");
client.write_notification(
"textDocument/didOpen",