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.rs292
1 files changed, 41 insertions, 251 deletions
diff --git a/cli/tests/integration/lsp_tests.rs b/cli/tests/integration/lsp_tests.rs
index 2fc3d29e8..ba44c670d 100644
--- a/cli/tests/integration/lsp_tests.rs
+++ b/cli/tests/integration/lsp_tests.rs
@@ -9059,12 +9059,27 @@ fn lsp_workspace_symbol() {
"text": "export class B {\n fieldC: string;\n fieldD: string;\n}\n",
}
}));
- let res = client.write_request(
+ let mut res = client.write_request(
"workspace/symbol",
json!({
"query": "field"
}),
);
+
+ // Replace `range` fields with `null` values. These are not important
+ // for assertion and require to be updated if we change unstable APIs.
+ for obj in res.as_array_mut().unwrap().iter_mut() {
+ *obj
+ .as_object_mut()
+ .unwrap()
+ .get_mut("location")
+ .unwrap()
+ .as_object_mut()
+ .unwrap()
+ .get_mut("range")
+ .unwrap() = Value::Null;
+ }
+
assert_eq!(
res,
json!([
@@ -9073,16 +9088,7 @@ fn lsp_workspace_symbol() {
"kind": 8,
"location": {
"uri": "file:///a/file.ts",
- "range": {
- "start": {
- "line": 1,
- "character": 2
- },
- "end": {
- "line": 1,
- "character": 17
- }
- }
+ "range": null,
},
"containerName": "A"
},
@@ -9091,16 +9097,7 @@ fn lsp_workspace_symbol() {
"kind": 8,
"location": {
"uri": "file:///a/file.ts",
- "range": {
- "start": {
- "line": 2,
- "character": 2
- },
- "end": {
- "line": 2,
- "character": 17
- }
- }
+ "range": null,
},
"containerName": "A"
},
@@ -9109,16 +9106,7 @@ fn lsp_workspace_symbol() {
"kind": 8,
"location": {
"uri": "file:///a/file_01.ts",
- "range": {
- "start": {
- "line": 1,
- "character": 2
- },
- "end": {
- "line": 1,
- "character": 17
- }
- }
+ "range": null,
},
"containerName": "B"
},
@@ -9127,16 +9115,7 @@ fn lsp_workspace_symbol() {
"kind": 8,
"location": {
"uri": "file:///a/file_01.ts",
- "range": {
- "start": {
- "line": 2,
- "character": 2
- },
- "end": {
- "line": 2,
- "character": 17
- }
- }
+ "range": null,
},
"containerName": "B"
},
@@ -9145,16 +9124,7 @@ fn lsp_workspace_symbol() {
"kind": 6,
"location": {
"uri": "deno:/asset/lib.deno.unstable.d.ts",
- "range": {
- "start": {
- "line": 3165,
- "character": 4
- },
- "end": {
- "line": 3165,
- "character": 55
- }
- }
+ "range": null,
},
"containerName": "CalendarProtocol"
},
@@ -9163,16 +9133,7 @@ fn lsp_workspace_symbol() {
"kind": 6,
"location": {
"uri": "deno:/asset/lib.deno.unstable.d.ts",
- "range": {
- "start": {
- "line": 3335,
- "character": 4
- },
- "end": {
- "line": 3335,
- "character": 47
- }
- }
+ "range": null,
},
"containerName": "Calendar"
},
@@ -9181,16 +9142,7 @@ fn lsp_workspace_symbol() {
"kind": 11,
"location": {
"uri": "deno:/asset/lib.decorators.d.ts",
- "range": {
- "start": {
- "line": 343,
- "character": 0
- },
- "end": {
- "line": 385,
- "character": 1
- }
- }
+ "range": null,
},
"containerName": ""
},
@@ -9199,16 +9151,7 @@ fn lsp_workspace_symbol() {
"kind": 6,
"location": {
"uri": "deno:/asset/lib.deno.unstable.d.ts",
- "range": {
- "start": {
- "line": 3143,
- "character": 4
- },
- "end": {
- "line": 3146,
- "character": 26
- }
- }
+ "range": null,
},
"containerName": "CalendarProtocol"
},
@@ -9217,16 +9160,7 @@ fn lsp_workspace_symbol() {
"kind": 6,
"location": {
"uri": "deno:/asset/lib.deno.unstable.d.ts",
- "range": {
- "start": {
- "line": 3313,
- "character": 4
- },
- "end": {
- "line": 3316,
- "character": 26
- }
- }
+ "range": null,
},
"containerName": "Calendar"
},
@@ -9235,16 +9169,7 @@ fn lsp_workspace_symbol() {
"kind": 6,
"location": {
"uri": "deno:/asset/lib.deno.unstable.d.ts",
- "range": {
- "start": {
- "line": 3439,
- "character": 4
- },
- "end": {
- "line": 3439,
- "character": 39
- }
- }
+ "range": null,
},
"containerName": "PlainDate"
},
@@ -9253,16 +9178,7 @@ fn lsp_workspace_symbol() {
"kind": 6,
"location": {
"uri": "deno:/asset/lib.deno.unstable.d.ts",
- "range": {
- "start": {
- "line": 3602,
- "character": 4
- },
- "end": {
- "line": 3602,
- "character": 43
- }
- }
+ "range": null,
},
"containerName": "PlainDateTime"
},
@@ -9271,16 +9187,7 @@ fn lsp_workspace_symbol() {
"kind": 6,
"location": {
"uri": "deno:/asset/lib.deno.unstable.d.ts",
- "range": {
- "start": {
- "line": 3651,
- "character": 4
- },
- "end": {
- "line": 3651,
- "character": 39
- }
- }
+ "range": null,
},
"containerName": "PlainMonthDay"
},
@@ -9289,16 +9196,7 @@ fn lsp_workspace_symbol() {
"kind": 6,
"location": {
"uri": "deno:/asset/lib.deno.unstable.d.ts",
- "range": {
- "start": {
- "line": 3770,
- "character": 4
- },
- "end": {
- "line": 3770,
- "character": 39
- }
- }
+ "range": null,
},
"containerName": "PlainTime"
},
@@ -9307,16 +9205,7 @@ fn lsp_workspace_symbol() {
"kind": 6,
"location": {
"uri": "deno:/asset/lib.deno.unstable.d.ts",
- "range": {
- "start": {
- "line": 3923,
- "character": 4
- },
- "end": {
- "line": 3923,
- "character": 39
- }
- }
+ "range": null,
},
"containerName": "PlainYearMonth"
},
@@ -9325,16 +9214,7 @@ fn lsp_workspace_symbol() {
"kind": 6,
"location": {
"uri": "deno:/asset/lib.deno.unstable.d.ts",
- "range": {
- "start": {
- "line": 4082,
- "character": 4
- },
- "end": {
- "line": 4082,
- "character": 43
- }
- }
+ "range": null,
},
"containerName": "ZonedDateTime"
},
@@ -9343,16 +9223,7 @@ fn lsp_workspace_symbol() {
"kind": 6,
"location": {
"uri": "deno:/asset/lib.deno.unstable.d.ts",
- "range": {
- "start": {
- "line": 3166,
- "character": 4
- },
- "end": {
- "line": 3169,
- "character": 31
- }
- }
+ "range": null,
},
"containerName": "CalendarProtocol"
},
@@ -9361,16 +9232,7 @@ fn lsp_workspace_symbol() {
"kind": 6,
"location": {
"uri": "deno:/asset/lib.deno.unstable.d.ts",
- "range": {
- "start": {
- "line": 3336,
- "character": 4
- },
- "end": {
- "line": 3339,
- "character": 31
- }
- }
+ "range": null,
},
"containerName": "Calendar"
},
@@ -9379,16 +9241,7 @@ fn lsp_workspace_symbol() {
"kind": 6,
"location": {
"uri": "deno:/asset/lib.deno.unstable.d.ts",
- "range": {
- "start": {
- "line": 3151,
- "character": 4
- },
- "end": {
- "line": 3154,
- "character": 30
- }
- }
+ "range": null,
},
"containerName": "CalendarProtocol"
},
@@ -9397,16 +9250,7 @@ fn lsp_workspace_symbol() {
"kind": 6,
"location": {
"uri": "deno:/asset/lib.deno.unstable.d.ts",
- "range": {
- "start": {
- "line": 3321,
- "character": 4
- },
- "end": {
- "line": 3324,
- "character": 30
- }
- }
+ "range": null,
},
"containerName": "Calendar"
},
@@ -9415,16 +9259,7 @@ fn lsp_workspace_symbol() {
"kind": 5,
"location": {
"uri": "deno:/asset/lib.deno.unstable.d.ts",
- "range": {
- "start": {
- "line": 3355,
- "character": 2
- },
- "end": {
- "line": 3360,
- "character": 4
- }
- }
+ "range": null,
},
"containerName": "Temporal"
},
@@ -9433,16 +9268,7 @@ fn lsp_workspace_symbol() {
"kind": 5,
"location": {
"uri": "deno:/asset/lib.deno.unstable.d.ts",
- "range": {
- "start": {
- "line": 3466,
- "character": 2
- },
- "end": {
- "line": 3477,
- "character": 4
- }
- }
+ "range": null,
},
"containerName": "Temporal"
},
@@ -9451,16 +9277,7 @@ fn lsp_workspace_symbol() {
"kind": 5,
"location": {
"uri": "deno:/asset/lib.deno.unstable.d.ts",
- "range": {
- "start": {
- "line": 3671,
- "character": 2
- },
- "end": {
- "line": 3678,
- "character": 4
- }
- }
+ "range": null,
},
"containerName": "Temporal"
},
@@ -9469,16 +9286,7 @@ fn lsp_workspace_symbol() {
"kind": 6,
"location": {
"uri": "deno:/asset/lib.deno.unstable.d.ts",
- "range": {
- "start": {
- "line": 3147,
- "character": 4
- },
- "end": {
- "line": 3150,
- "character": 31
- }
- }
+ "range": null,
},
"containerName": "CalendarProtocol"
},
@@ -9487,16 +9295,7 @@ fn lsp_workspace_symbol() {
"kind": 6,
"location": {
"uri": "deno:/asset/lib.deno.unstable.d.ts",
- "range": {
- "start": {
- "line": 3317,
- "character": 4
- },
- "end": {
- "line": 3320,
- "character": 31
- }
- }
+ "range": null,
},
"containerName": "Calendar"
},
@@ -9505,16 +9304,7 @@ fn lsp_workspace_symbol() {
"kind": 5,
"location": {
"uri": "deno:/asset/lib.deno.unstable.d.ts",
- "range": {
- "start": {
- "line": 3952,
- "character": 2
- },
- "end": {
- "line": 3965,
- "character": 4
- }
- }
+ "range": null,
},
"containerName": "Temporal"
}