diff --git a/CHANGES.md b/CHANGES.md index 19abd0c9c0..86cbbeed95 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,6 +13,7 @@ Sat Dec 20 11:15:42 CET 2025 + test suite - Add a test to ensure the behavior showed in issue #1517 is no longer relevant (#1995) - Add a test to ensure the code fragment exhibited in issue #1118 no longer makes Merlin crash (#1996) + - Add a test to ensure the behavior showed in issue #1980 - Add a test case illustrating how a snippet produces two unrelated errors in issue #2000. (#2003) - Add a test reproducing issue #1983 where `document` command which sometime concatenates consecutive variants and labels (#2005) - Signature-help should trigger on unfinished `let ... in` bindings (#2009) diff --git a/tests/test-dirs/issue1980.t b/tests/test-dirs/issue1980.t new file mode 100644 index 0000000000..fc1c42dfa7 --- /dev/null +++ b/tests/test-dirs/issue1980.t @@ -0,0 +1,32 @@ + $ cat > test.ml < module rec M : sig + > val f : unit -> unit + > end = struct + > let f () = () + > end + > and N : sig + > val foo : unit -> unit + > end = struct + > let foo () = M.f () + > end + > let foo () = M.f () + > EOF + + $ ocamlmerlin single locate -position 11:16 -look-for implementation -filename test.ml < test.ml | jq .value + { + "file": "$TESTCASE_ROOT/test.ml", + "pos": { + "line": 4, + "col": 6 + } + } + +-- FIXME : Merlin should return the definition position instead of the declaration one + $ ocamlmerlin single locate -position 9:18 -look-for implementation -filename test.ml < test.ml | jq .value + { + "file": "$TESTCASE_ROOT/test.ml", + "pos": { + "line": 2, + "col": 6 + } + }