Skip to content

Commit

Permalink
test: illustrate shortcomings of Merlin when lid have spaces or comme…
Browse files Browse the repository at this point in the history
…ntaries in them
  • Loading branch information
voodoos committed Jan 16, 2024
1 parent 217fdca commit 3f991d1
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions tests/test-dirs/occurrences/modules-in-path.t
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
$ cat >main.ml <<'EOF'
> module N = struct module M = struct let x = 42 end end
> let () = print_int N.M.x
> let () = print_int N.M.(*comment*)x
> EOF

FIXME: longident with spaces will be highlighted incorrectly

$ $MERLIN single occurrences -identifier-at 1:25 \
> -filename main.ml <main.ml
{
Expand All @@ -27,6 +30,16 @@
"line": 2,
"col": 22
}
},
{
"start": {
"line": 3,
"col": 32
},
"end": {
"line": 3,
"col": 33
}
}
],
"notifications": []
Expand Down Expand Up @@ -56,7 +69,35 @@
"line": 2,
"col": 20
}
},
{
"start": {
"line": 3,
"col": 30
},
"end": {
"line": 3,
"col": 31
}
}
],
"notifications": []
}


FIXME: reconstruct identifier does not handle correctly longidents with comments
between components.
$ $MERLIN single occurrences -identifier-at 3:34 \
> -log-file - -log-section locate \
> -filename main.ml <main.ml
# 0.01 locate - reconstructed identifier
x
# 0.01 locate - from_string
inferred context: expression
# 0.01 locate - from_string
looking for the source of 'x' (prioritizing .ml files)
{
"class": "return",
"value": [],
"notifications": []
}

0 comments on commit 3f991d1

Please sign in to comment.