From edb076f2edf3c2b0bab28a3ba33b9fbd1aa311ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulysse=20G=C3=A9rard?= Date: Mon, 3 Mar 2025 18:33:26 +0100 Subject: [PATCH 1/3] Move short paths tests in a sub folder --- tests/test-dirs/{ => short-paths}/short-paths.t/dep.mli | 0 tests/test-dirs/{ => short-paths}/short-paths.t/run.t | 0 tests/test-dirs/{ => short-paths}/short-paths.t/test.ml | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename tests/test-dirs/{ => short-paths}/short-paths.t/dep.mli (100%) rename tests/test-dirs/{ => short-paths}/short-paths.t/run.t (100%) rename tests/test-dirs/{ => short-paths}/short-paths.t/test.ml (100%) diff --git a/tests/test-dirs/short-paths.t/dep.mli b/tests/test-dirs/short-paths/short-paths.t/dep.mli similarity index 100% rename from tests/test-dirs/short-paths.t/dep.mli rename to tests/test-dirs/short-paths/short-paths.t/dep.mli diff --git a/tests/test-dirs/short-paths.t/run.t b/tests/test-dirs/short-paths/short-paths.t/run.t similarity index 100% rename from tests/test-dirs/short-paths.t/run.t rename to tests/test-dirs/short-paths/short-paths.t/run.t diff --git a/tests/test-dirs/short-paths.t/test.ml b/tests/test-dirs/short-paths/short-paths.t/test.ml similarity index 100% rename from tests/test-dirs/short-paths.t/test.ml rename to tests/test-dirs/short-paths/short-paths.t/test.ml From 412afe55994e14c25c13b6505050f06e81f5d668 Mon Sep 17 00:00:00 2001 From: Liam Stevenson Date: Mon, 3 Mar 2025 18:36:15 +0100 Subject: [PATCH 2/3] Add test for short-paths proposed in #1873 --- tests/test-dirs/short-paths/issue1873.t | 45 +++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 tests/test-dirs/short-paths/issue1873.t diff --git a/tests/test-dirs/short-paths/issue1873.t b/tests/test-dirs/short-paths/issue1873.t new file mode 100644 index 0000000000..4df0dc52b6 --- /dev/null +++ b/tests/test-dirs/short-paths/issue1873.t @@ -0,0 +1,45 @@ +We get a bad path for `hello` + + $ cat > foo.ml < module Foo = struct + > type t + > end + > + > module Bar = struct + > module Foo = struct + > type t = Foo.t + > end + > end + > + > open! Bar + > + > let hello : Foo.t = 0 + > EOF + +It happens regardless of whether short-paths is enabled + $ $MERLIN single type-enclosing -position 13:5 -filename foo.ml < foo.ml | jq .value[0].type -r + Bar.Foo.t + + $ echo "FLG -short-paths" > .merlin + $ $MERLIN single type-enclosing -position 13:5 -filename foo.ml < foo.ml | jq .value[0].type -r + Bar.Foo.t + +It seems to be related to shadowing somehow. This works: + $ cat > foo.ml < module Foo = struct + > type t + > end + > + > module Bar = struct + > module Baz = struct + > type t = Foo.t + > end + > end + > + > open! Bar + > + > let hello : Baz.t = 0 + > EOF + + $ $MERLIN single type-enclosing -position 13:5 -filename foo.ml < foo.ml | jq .value[0].type -r + Foo.t From f85949bb7df376d5cab6c0b9c307e69b800c032f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulysse=20G=C3=A9rard?= Date: Mon, 3 Mar 2025 18:38:54 +0100 Subject: [PATCH 3/3] Add a changelog entry --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index cde92d2fa9..2c6697a784 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -12,6 +12,7 @@ unreleased of the involved data-structures. (#1889) + test suite - Add a test case illustrating wrong open order proposed in issue #1900. (#1901) + - Add more short-paths tests cases (#1904) merlin 5.4.1 ============