Skip to content

Commit

Permalink
test: additional cases
Browse files Browse the repository at this point in the history
  • Loading branch information
voodoos committed Sep 2, 2024
1 parent 9889ab7 commit 6c89957
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions tests/test-dirs/signature-help/sh-mix.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
$ cat >test.ml <<'EOF'
> let f x ~lbl_a y ~lbl_b z = ignore (x, lbl_a, lbl_b, z)
> let _ = f
> EOF

First is the first parameter:
$ $MERLIN single signature-help -position 2:11 -filename test <test.ml |
> jq '.value.activeParameter'
0

$ cat >test.ml <<'EOF'
> let f x ~lbl_a y ~lbl_b z = ignore (x, lbl_a, lbl_b, z)
> let _ = f 0
> EOF

FIXME: After we expect the next non-labelled parameter to be active:
$ $MERLIN single signature-help -position 2:12 -filename test <test.ml |
> jq '.value.activeParameter'
0

$ cat >test.ml <<'EOF'
> let f x ~lbl_a y ~lbl_b z = ignore (x, lbl_a, lbl_b, z)
> let _ = f 0 3
> EOF

It does happen when the expression is being writter:
$ $MERLIN single signature-help -position 2:12 -filename test <test.ml |
> jq '.value.activeParameter'
2

$ cat >test.ml <<'EOF'
> let f x ~lbl_a y ~lbl_b z = ignore (x, lbl_a, lbl_b, z)
> let _ = f 0 ~
> EOF

And when a tilde is used the first labelled arg is higlighted:
$ $MERLIN single signature-help -position 2:13 -filename test <test.ml |
> jq '.value.activeParameter'
1

$ cat >test.ml <<'EOF'
> let f x ~lbl_a y ~lbl_b z = ignore (x, lbl_a, lbl_b, z)
> let _ = f 0 ~lbl_b
> EOF

Or the second one is the name corresponds:
$ $MERLIN single signature-help -position 2:18 -filename test <test.ml |
> jq '.value.activeParameter'
3
File renamed without changes.

0 comments on commit 6c89957

Please sign in to comment.