diff --git a/tests/test-dirs/with-ppx/dune b/tests/test-dirs/with-ppx/dune index f29d480b73..5a55c21031 100644 --- a/tests/test-dirs/with-ppx/dune +++ b/tests/test-dirs/with-ppx/dune @@ -3,5 +3,5 @@ (locks ../server-tests/merlin_server)) (cram - (applies_to issue1660-deriving-compare) + (applies_to issue1660-deriving-compare issue1671-string) (enabled_if (= %{env:MERLIN_TESTS=default} all))) diff --git a/tests/test-dirs/with-ppx/issue1671-string.t b/tests/test-dirs/with-ppx/issue1671-string.t new file mode 100644 index 0000000000..46d347b6b3 --- /dev/null +++ b/tests/test-dirs/with-ppx/issue1671-string.t @@ -0,0 +1,124 @@ + $ cat >dune-project < (lang dune 2.0) + > EOF + + $ cat >main.ml < let f x = + > [%string + > "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \ + > %{x}"] + > ;; + > print_endline @@ f "42";; + > EOF + + $ cat >dune < (executable + > (name main) + > (preprocess (pps ppx_string))) + + $ dune build @check + + $ dune exec ./main.exe + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 42 + +FIX upstream: locs issued by the ppx does not enable Merlin to work as expected + $ $MERLIN single type-enclosing -position 3:7 \ + > -filename main.ml string", + "tail": "no" + } + ], + "notifications": [] + } + +FIXME: Merlin should ignore hidden nodes in occurrences results to prevent +broken renaming + $ $MERLIN single occurrences -identifier-at 1:6 \ + > -filename main.ml + pattern (main.ml[1,0+4]..main.ml[1,0+5]) + Tpat_var \"f/273\" + expression (main.ml[1,0+6]..main.ml[3,21+97]) ghost + Texp_function + Nolabel + [ + + pattern (main.ml[1,0+6]..main.ml[1,0+7]) + Tpat_var \"x/275\" + expression (main.ml[2,10+2]..main.ml[3,21+97]) + attribute \"merlin.hide\" + [] + Texp_apply + expression (main.ml[2,10+2]..main.ml[3,21+97]) + Texp_ident \"Stdlib!.String.concat\" + [ + + Nolabel + expression (main.ml[2,10+2]..main.ml[3,21+97]) + Texp_constant Const_string(\"\",(main.ml[2,10+2]..main.ml[3,21+97]),None) + + Nolabel + expression (main.ml[2,10+2]..main.ml[3,21+97]) + Texp_construct \"::\" + [ + expression (main.ml[3,21+5]..main.ml[3,21+91]) ghost + Texp_constant Const_string(\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \",(main.ml[3,21+5]..main.ml[3,21+91]) ghost,None) + expression (main.ml[2,10+2]..main.ml[3,21+97]) + Texp_construct \"::\" + [ + expression (main.ml[3,21+93]..main.ml[3,21+94]) + Texp_ident \"x/275\" + expression (main.ml[2,10+2]..main.ml[3,21+97]) + Texp_construct \"[]\" + [] + ] + ] + ] + ] + ] + structure_item (main.ml[5,122+0]..main.ml[5,122+23]) + Tstr_eval + expression (main.ml[5,122+0]..main.ml[5,122+23]) + Texp_apply + expression (main.ml[5,122+0]..main.ml[5,122+13]) + Texp_ident \"Stdlib!.print_endline\" + [ + + Nolabel + expression (main.ml[5,122+17]..main.ml[5,122+23]) + Texp_apply + expression (main.ml[5,122+17]..main.ml[5,122+18]) + Texp_ident \"f/273\" + [ + + Nolabel + expression (main.ml[5,122+19]..main.ml[5,122+23]) + Texp_constant Const_string(\"42\",(main.ml[5,122+20]..main.ml[5,122+22]),None) + ] + ] + ] + + + ", + "notifications": [] + }