Skip to content

Commit 4524091

Browse files
committed
Add a test reproducing the issue #2033.
1 parent 1c4148a commit 4524091

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ unreleased
1212
- Add reproduction case for #1763 but it is not failing anymore (#2021)
1313
- Add a test to reproduce [Locate command fails on multi-line type definitions](#1987) (#2020)
1414
- Add a regression test for issue #2019 (#2030)
15+
- Add a test reproducing the locate command failure when editor position is in another declaration (#2033)
1516

1617
merlin 5.6.1
1718
============

tests/test-dirs/issue2033.t

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
$ cat >main.mli <<EOF
2+
> type typ =
3+
> | A
4+
> | B
5+
> | C
6+
>
7+
> val string_of_type : typ -> string
8+
> EOF
9+
10+
Work as intended:
11+
$ $MERLIN single locate -prefix typ -position 5:0 -context unknown -look-for mli -filename main.mli <main.mli
12+
{
13+
"class": "return",
14+
"value": {
15+
"file": "$TESTCASE_ROOT/main.mli",
16+
"pos": {
17+
"line": 1,
18+
"col": 5
19+
}
20+
},
21+
"notifications": []
22+
}
23+
24+
TODO: trying to find the `typ` declaration with the cursor positioned on a signature item located after the type definition fails:
25+
$ $MERLIN single locate -prefix typ -position 6:10 -context unknown -look-for mli -filename main.mli <main.mli
26+
{
27+
"class": "return",
28+
"value": "Already at definition point",
29+
"notifications": []
30+
}

0 commit comments

Comments
 (0)