diff --git a/CHANGES.md b/CHANGES.md index a65ef68091..d7ba2754e3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,6 +7,7 @@ unreleased - Improve recovery of mutually recursive definitions (#1962, #1963, fixes #1953) + vim plugin - Fix error when `:MerlinOccurrencesProjectWide` fails to gather code previews (#1970) + - Add more short-paths tests cases (#1904) merlin 5.5 ========== 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