forked from ocaml/merlin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
issue1513.t
58 lines (47 loc) · 1.39 KB
/
issue1513.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Merlin should show comments for a type's constructor from another module:
$ cat >naux.ml <<EOF
> type t =
> | A
> (**A Comment *)
> | B
> (**B Comment *)
> | C
> EOF
$ cat >main.ml <<EOF
> let _ = Naux.A
> let _ = Naux.B
> let _ = Naux.C
> EOF
$ $OCAMLC -c -bin-annot naux.ml
FIXME: the constructors are missing from the [uid_to_loc] tables
$ $MERLIN single document -position 1:13 \
> -filename main.ml <main.ml | jq '.value'
"didn't manage to find Naux.t"
$ $MERLIN single document -position 2:13 \
> -filename main.ml <main.ml | tr '\n' ' ' | jq '.value'
"didn't manage to find Naux.t"
$ $MERLIN single document -position 3:13 \
> -filename main.ml <main.ml | jq '.value'
"didn't manage to find Naux.t"
$ rm naux.cmt
Merlin should show comments for a type's constructor from the current module:
$ cat >main.ml <<EOF
> type t =
> | A
> (**A Comment *)
> | B
> (**B Comment *)
> | C
> EOF
$ $MERLIN single document -position 2:4 \
> -filename main.ml <main.ml | jq '.value'
"A Comment"
FIXME: expected "B Comment"
$ $MERLIN single document -position 4:4 \
> -filename main.ml <main.ml | tr '\n' ' ' | jq '.value'
"A Comment B Comment"
FIXME: expected ""
$ $MERLIN single document -position 6:4 \
> -filename main.ml <main.ml | jq '.value'
"B Comment"
The issue probaby lies in the heuristics in [ocamldoc.ml]