Skip to content

Commit

Permalink
test: add case for worksapce symbol search
Browse files Browse the repository at this point in the history
in particular, when dune rules are copying sources around
  • Loading branch information
tatchi authored and rgrinberg committed Apr 15, 2022
1 parent 6a38d66 commit 6caad6c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ocaml-lsp-server/test/e2e/__tests__/workspace-symbol.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,15 @@ describe("workspace/symbol", () => {
"a_b_t 15 file://<workspace_symbol_A>/bin/a.ml 3:2 3:21",
"a_x 12 file://<workspace_symbol_A>/bin/a.ml 0:0 0:11",
"main_y 12 file://<workspace_symbol_A>/bin/main.ml 0:0 0:22",
"vendored_x 12 file://<workspace_symbol_A>/lib/lib.ml 14:0 14:31",
"lib_type 12 file://<workspace_symbol_A>/lib/lib.ml 12:0 12:38",
"lib_private_fn 12 file://<workspace_symbol_A>/lib/lib.ml 10:0 10:38",
"hd 12 file://<workspace_symbol_A>/lib/lib.ml 8:0 8:16",
"lib_x 12 file://<workspace_symbol_A>/lib/lib.ml 6:0 6:14",
"user 15 file://<workspace_symbol_A>/lib/lib.ml 3:0 5:1",
"name 7 file://<workspace_symbol_A>/lib/lib.ml 4:2 4:14",
"t 15 file://<workspace_symbol_A>/lib/LibTypes.mli 0:0 0:15",
"x 12 file://<workspace_symbol_A>/lib/vendored_lib.ml 0:0 0:9",
]
`);
});
Expand Down Expand Up @@ -177,13 +179,15 @@ describe("workspace/symbol", () => {
"a_b_t 15 file://<workspace_symbol_A>/bin/a.ml 3:2 3:21",
"a_x 12 file://<workspace_symbol_A>/bin/a.ml 0:0 0:11",
"main_y 12 file://<workspace_symbol_A>/bin/main.ml 0:0 0:22",
"vendored_x 12 file://<workspace_symbol_A>/lib/lib.ml 14:0 14:31",
"lib_type 12 file://<workspace_symbol_A>/lib/lib.ml 12:0 12:38",
"lib_private_fn 12 file://<workspace_symbol_A>/lib/lib.ml 10:0 10:38",
"hd 12 file://<workspace_symbol_A>/lib/lib.ml 8:0 8:16",
"lib_x 12 file://<workspace_symbol_A>/lib/lib.ml 6:0 6:14",
"user 15 file://<workspace_symbol_A>/lib/lib.ml 3:0 5:1",
"name 7 file://<workspace_symbol_A>/lib/lib.ml 4:2 4:14",
"t 15 file://<workspace_symbol_A>/lib/LibTypes.mli 0:0 0:15",
"x 12 file://<workspace_symbol_A>/lib/vendored_lib.ml 0:0 0:9",
"workspace_B 12 file://<workspace_symbol_B>/main.ml 0:0 0:31",
]
`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
(modules_without_implementation libTypes)
(flags :standard -w -32-38-27-34)
(name lib))


(copy_files# ../vendor/*.ml{,i})
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ let hd = List.hd
let lib_private_fn s = print_endline s

let lib_type: LibTypes.t = "lib_types"

let vendored_x = Vendored_lib.x
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let x = 5

0 comments on commit 6caad6c

Please sign in to comment.