diff --git a/tests/test-dirs/config/dot-merlin-reader/quoting.t b/tests/test-dirs/config/dot-merlin-reader/quoting.t index a9363083d5..b7ac9857e8 100644 --- a/tests/test-dirs/config/dot-merlin-reader/quoting.t +++ b/tests/test-dirs/config/dot-merlin-reader/quoting.t @@ -51,6 +51,7 @@ } ], "stdlib": null, + "index_file": null, "reader": [], "protocol": "json", "log_file": null, diff --git a/tests/test-dirs/locate/in-implicit-trans-dep.t/run.t b/tests/test-dirs/locate/in-implicit-trans-dep.t/run.t index d844c52eb1..7427839f88 100644 --- a/tests/test-dirs/locate/in-implicit-trans-dep.t/run.t +++ b/tests/test-dirs/locate/in-implicit-trans-dep.t/run.t @@ -1,12 +1,18 @@ $ dune build @check -FIXME: When the deifinition is in one of the implicit transitive dependencies -Merlin does not found the file in the source path provided by Dune. One possible -fix would be for Dune to provide additional source path for "externatl" deps. +When the definition is in one of the implicit transitive dependencies +Merlin does not find the file in the source path provided by Dune. One possible +fix would be for Dune to provide additional source path for "external" deps. $ $MERLIN single locate -look-for ml -position 1:15 \ > -filename bin/main.ml constr.mli < type t = A of int | B + > type u = { label_a : int } > EOF $ cat >constr.ml < type u = C of int + > type u = { label_a : int } > type t = A of int | B > let foo : t = A 42 > EOF $ cat >main.ml < let foo : Constr.t = Constr.A 42 + > let bar : Constr.u = { Constr.label_a = 42 } > EOF $ $OCAMLC -c -bin-annot -store-usage-index constr.mli constr.ml @@ -38,6 +40,26 @@ } } + $ $MERLIN single locate -look-for mli -position 2:30 \ + > -filename ./main.ml < ./main.ml | jq '.value' + { + "file": "$TESTCASE_ROOT/constr.mli", + "pos": { + "line": 2, + "col": 11 + } + } + + $ $MERLIN single locate -look-for ml -position 2:30 \ + > -filename ./main.ml < ./main.ml | jq '.value' + { + "file": "$TESTCASE_ROOT/constr.ml", + "pos": { + "line": 1, + "col": 11 + } + } + $ cat >main.ml < module Constr : sig > type t = A of int | B diff --git a/tests/test-dirs/occurrences/constrs-decl-def.t b/tests/test-dirs/occurrences/constrs-decl-def.t new file mode 100644 index 0000000000..06a0343b53 --- /dev/null +++ b/tests/test-dirs/occurrences/constrs-decl-def.t @@ -0,0 +1,189 @@ + $ cat >main.ml <<'EOF' + > module M : sig + > type t = A of { label_a : int } + > end = struct + > type t = A of { label_a : int } + > let _ = A { label_a = 1 } + > end + > + > let _ = M.A { label_a = 1 } + > + > open M + > + > let _ = A { label_a = 1 } + > EOF + +Constructor declaration: + $ $MERLIN single locate -look-for mli -position 12:8 \ + > -filename main.ml -filename main.ml -filename main.ml -filename main.ml -filename main.ml -filename main.ml main.ml <<'EOF' + > type t = { a : int; b : float } + > let _ = { a = 4; b = 2.0 } + > let a = 4 + > let r = { a; b = 2.0 } + > let _ = { r with b = 2.0 } + > let { a; b } = r + > EOF + + $ $MERLIN single occurrences -identifier-at 6:15 \ + > -filename main.ml -filename main.ml EOF $ dune build @all - ld: warning: -undefined suppress is deprecated - ld: warning: -undefined suppress is deprecated - ld: warning: -undefined suppress is deprecated - ld: warning: -undefined suppress is deprecated $ ocaml-index dump _build/default/project.ocaml-index 3 uids: