Skip to content

Commit 6caad6c

Browse files
tatchirgrinberg
authored andcommitted
test: add case for worksapce symbol search
in particular, when dune rules are copying sources around
1 parent 6a38d66 commit 6caad6c

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

ocaml-lsp-server/test/e2e/__tests__/workspace-symbol.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,15 @@ describe("workspace/symbol", () => {
9999
"a_b_t 15 file://<workspace_symbol_A>/bin/a.ml 3:2 3:21",
100100
"a_x 12 file://<workspace_symbol_A>/bin/a.ml 0:0 0:11",
101101
"main_y 12 file://<workspace_symbol_A>/bin/main.ml 0:0 0:22",
102+
"vendored_x 12 file://<workspace_symbol_A>/lib/lib.ml 14:0 14:31",
102103
"lib_type 12 file://<workspace_symbol_A>/lib/lib.ml 12:0 12:38",
103104
"lib_private_fn 12 file://<workspace_symbol_A>/lib/lib.ml 10:0 10:38",
104105
"hd 12 file://<workspace_symbol_A>/lib/lib.ml 8:0 8:16",
105106
"lib_x 12 file://<workspace_symbol_A>/lib/lib.ml 6:0 6:14",
106107
"user 15 file://<workspace_symbol_A>/lib/lib.ml 3:0 5:1",
107108
"name 7 file://<workspace_symbol_A>/lib/lib.ml 4:2 4:14",
108109
"t 15 file://<workspace_symbol_A>/lib/LibTypes.mli 0:0 0:15",
110+
"x 12 file://<workspace_symbol_A>/lib/vendored_lib.ml 0:0 0:9",
109111
]
110112
`);
111113
});
@@ -177,13 +179,15 @@ describe("workspace/symbol", () => {
177179
"a_b_t 15 file://<workspace_symbol_A>/bin/a.ml 3:2 3:21",
178180
"a_x 12 file://<workspace_symbol_A>/bin/a.ml 0:0 0:11",
179181
"main_y 12 file://<workspace_symbol_A>/bin/main.ml 0:0 0:22",
182+
"vendored_x 12 file://<workspace_symbol_A>/lib/lib.ml 14:0 14:31",
180183
"lib_type 12 file://<workspace_symbol_A>/lib/lib.ml 12:0 12:38",
181184
"lib_private_fn 12 file://<workspace_symbol_A>/lib/lib.ml 10:0 10:38",
182185
"hd 12 file://<workspace_symbol_A>/lib/lib.ml 8:0 8:16",
183186
"lib_x 12 file://<workspace_symbol_A>/lib/lib.ml 6:0 6:14",
184187
"user 15 file://<workspace_symbol_A>/lib/lib.ml 3:0 5:1",
185188
"name 7 file://<workspace_symbol_A>/lib/lib.ml 4:2 4:14",
186189
"t 15 file://<workspace_symbol_A>/lib/LibTypes.mli 0:0 0:15",
190+
"x 12 file://<workspace_symbol_A>/lib/vendored_lib.ml 0:0 0:9",
187191
"workspace_B 12 file://<workspace_symbol_B>/main.ml 0:0 0:31",
188192
]
189193
`);

ocaml-lsp-server/test/e2e/__tests__/workspace_symbol_A/lib/dune

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@
33
(modules_without_implementation libTypes)
44
(flags :standard -w -32-38-27-34)
55
(name lib))
6+
7+
8+
(copy_files# ../vendor/*.ml{,i})

ocaml-lsp-server/test/e2e/__tests__/workspace_symbol_A/lib/lib.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ let hd = List.hd
1111
let lib_private_fn s = print_endline s
1212

1313
let lib_type: LibTypes.t = "lib_types"
14+
15+
let vendored_x = Vendored_lib.x
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let x = 5

0 commit comments

Comments
 (0)