summaryrefslogtreecommitdiff
path: root/cli/tests/integration/lsp_tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/integration/lsp_tests.rs')
-rw-r--r--cli/tests/integration/lsp_tests.rs180
1 files changed, 63 insertions, 117 deletions
diff --git a/cli/tests/integration/lsp_tests.rs b/cli/tests/integration/lsp_tests.rs
index 336304db7..1d0e482fa 100644
--- a/cli/tests/integration/lsp_tests.rs
+++ b/cli/tests/integration/lsp_tests.rs
@@ -235,10 +235,7 @@ fn lsp_import_map_remote() {
"workspace/executeCommand",
json!({
"command": "deno.cache",
- "arguments": [
- [],
- temp_dir.uri().join("file.ts").unwrap(),
- ],
+ "arguments": [[], temp_dir.uri().join("file.ts").unwrap()],
}),
);
@@ -1966,12 +1963,10 @@ fn lsp_hover_dependency() {
}),
);
client.write_request(
- "deno/cache",
+ "workspace/executeCommand",
json!({
- "referrer": {
- "uri": "file:///a/file.ts",
- },
- "uris": [],
+ "command": "deno.cache",
+ "arguments": [[], "file:///a/file.ts"],
}),
);
let res = client.write_request(
@@ -2199,15 +2194,12 @@ fn lsp_hover_typescript_types() {
}),
);
client.write_request(
- "deno/cache",
+ "workspace/executeCommand",
json!({
- "referrer": {
- "uri": "file:///a/file.ts",
- },
- "uris": [
- {
- "uri": "http://127.0.0.1:4545/xTypeScriptTypes.js",
- }
+ "command": "deno.cache",
+ "arguments": [
+ ["http://127.0.0.1:4545/xTypeScriptTypes.js"],
+ "file:///a/file.ts",
],
}),
);
@@ -5809,18 +5801,13 @@ fn lsp_npm_completions_auto_import_and_quick_fix_no_import_map() {
}),
);
client.write_request(
- "deno/cache",
+ "workspace/executeCommand",
json!({
- "referrer": {
- "uri": "file:///a/file.ts",
- },
- "uris": [
- {
- "uri": "npm:@denotest/types-exports-subpaths@1/client",
- }, {
- "uri": "npm:chalk@5.0",
- }
- ]
+ "command": "deno.cache",
+ "arguments": [
+ ["npm:@denotest/types-exports-subpaths@1/client", "npm:chalk@5.0"],
+ "file:///a/file.ts",
+ ],
}),
);
@@ -6123,22 +6110,18 @@ fn lsp_completions_auto_import_and_quick_fix_with_import_map() {
}),
);
client.write_request(
- "deno/cache",
+ "workspace/executeCommand",
json!({
- "referrer": {
- "uri": "file:///a/file.ts",
- },
- "uris": [
- {
- "uri": "npm:@denotest/types-exports-subpaths@1/client",
- }, {
- "uri": "npm:chalk@^5.0",
- }, {
- "uri": "npm:chalk@~5",
- }, {
- "uri": "http://localhost:4545/subdir/print_hello.ts",
- }
- ]
+ "command": "deno.cache",
+ "arguments": [
+ [
+ "npm:@denotest/types-exports-subpaths@1/client",
+ "npm:chalk@^5.0",
+ "npm:chalk@~5",
+ "http://localhost:4545/subdir/print_hello.ts",
+ ],
+ "file:///a/file.ts",
+ ],
}),
);
@@ -6643,18 +6626,13 @@ fn lsp_completions_npm() {
}),
);
client.write_request(
- "deno/cache",
+ "workspace/executeCommand",
json!({
- "referrer": {
- "uri": "file:///a/file.ts",
- },
- "uris": [
- {
- "uri": "npm:@denotest/cjs-default-export",
- }, {
- "uri": "npm:chalk",
- }
- ]
+ "command": "deno.cache",
+ "arguments": [
+ ["npm:@denotest/cjs-default-export", "npm:chalk"],
+ "file:///a/file.ts",
+ ],
}),
);
@@ -7021,16 +6999,10 @@ fn lsp_completions_node_specifier() {
);
client.write_request(
- "deno/cache",
+ "workspace/executeCommand",
json!({
- "referrer": {
- "uri": "file:///a/file.ts",
- },
- "uris": [
- {
- "uri": "npm:@types/node",
- }
- ]
+ "command": "deno.cache",
+ "arguments": [["npm:@types/node"], "file:///a/file.ts"],
}),
);
@@ -7265,12 +7237,10 @@ fn lsp_cache_location() {
}));
assert_eq!(diagnostics.all().len(), 6);
client.write_request(
- "deno/cache",
+ "workspace/executeCommand",
json!({
- "referrer": {
- "uri": "file:///a/file.ts",
- },
- "uris": [],
+ "command": "deno.cache",
+ "arguments": [[], "file:///a/file.ts"],
}),
);
let res = client.write_request(
@@ -7361,12 +7331,10 @@ fn lsp_tls_cert() {
let diagnostics = diagnostics.all();
assert_eq!(diagnostics.len(), 6);
client.write_request(
- "deno/cache",
+ "workspace/executeCommand",
json!({
- "referrer": {
- "uri": "file:///a/file.ts",
- },
- "uris": [],
+ "command": "deno.cache",
+ "arguments": [[], "file:///a/file.ts"],
}),
);
let res = client.write_request(
@@ -7435,15 +7403,12 @@ fn lsp_diagnostics_warn_redirect() {
}),
);
client.write_request(
- "deno/cache",
+ "workspace/executeCommand",
json!({
- "referrer": {
- "uri": "file:///a/file.ts",
- },
- "uris": [
- {
- "uri": "http://127.0.0.1:4545/x_deno_warning.js",
- }
+ "command": "deno.cache",
+ "arguments": [
+ ["http://127.0.0.1:4545/x_deno_warning.js"],
+ "file:///a/file.ts",
],
}),
);
@@ -7514,15 +7479,12 @@ fn lsp_redirect_quick_fix() {
}),
);
client.write_request(
- "deno/cache",
+ "workspace/executeCommand",
json!({
- "referrer": {
- "uri": "file:///a/file.ts",
- },
- "uris": [
- {
- "uri": "http://127.0.0.1:4545/x_deno_warning.js",
- }
+ "command": "deno.cache",
+ "arguments": [
+ ["http://127.0.0.1:4545/x_deno_warning.js"],
+ "file:///a/file.ts",
],
}),
);
@@ -8984,14 +8946,13 @@ export function B() {
}
}));
client.write_request(
- "deno/cache",
+ "workspace/executeCommand",
json!({
- "referrer": {
- "uri": "file:///a/file.tsx",
- },
- "uris": [{
- "uri": "http://127.0.0.1:4545/jsx/jsx-runtime",
- }],
+ "command": "deno.cache",
+ "arguments": [
+ ["http://127.0.0.1:4545/jsx/jsx-runtime"],
+ "file:///a/file.tsx",
+ ],
}),
);
let res = client.write_request(
@@ -9550,19 +9511,10 @@ fn lsp_node_modules_dir() {
}));
let cache = |client: &mut LspClient| {
client.write_request(
- "deno/cache",
+ "workspace/executeCommand",
json!({
- "referrer": {
- "uri": file_uri,
- },
- "uris": [
- {
- "uri": "npm:chalk",
- },
- {
- "uri": "npm:@types/node",
- }
- ]
+ "command": "deno.cache",
+ "arguments": [["npm:chalk", "npm:@types/node"], file_uri],
}),
);
};
@@ -9688,16 +9640,10 @@ fn lsp_vendor_dir() {
}));
let cache = |client: &mut LspClient| {
client.write_request(
- "deno/cache",
+ "workspace/executeCommand",
json!({
- "referrer": {
- "uri": local_file_uri,
- },
- "uris": [
- {
- "uri": "http://localhost:4545/subdir/mod1.ts",
- }
- ]
+ "command": "deno.cache",
+ "arguments": [["http://localhost:4545/subdir/mod1.ts"], local_file_uri],
}),
);
};