Skip to content

Commit 6f31bc9

Browse files
committed
Check the optional active_param which should not trigger the signature help if none
1 parent 7f73240 commit 6f31bc9

File tree

2 files changed

+4
-30
lines changed

2 files changed

+4
-30
lines changed

src/frontend/query_commands.ml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -956,8 +956,11 @@ let dispatch pipeline (type a) : a Query_protocol.t -> a = function
956956
in
957957
match application_signature with
958958
| Some s ->
959+
(* The signature help should not appear on the name of the function. *)
959960
if Msource.compare_position source position s.function_position < 0 then
960961
None
962+
(* The signature help should not appear after the last parameter. *)
963+
else if s.active_param = None then None
961964
else
962965
let prefix =
963966
let fun_name = Option.value ~default:"_" s.function_name in

tests/test-dirs/signature-help/issue_looping_param.t

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -36,41 +36,12 @@
3636
"notifications": []
3737
}
3838

39-
FIXME: Once the function has all of its parameters, it should not loop again on the parameters
4039
$ $MERLIN single signature-help -position 2:16 <<EOF
4140
> let f x y z = x + y + z
4241
> let a = f 4 4 4
4342
> EOF
4443
{
4544
"class": "return",
46-
"value": {
47-
"signatures": [
48-
{
49-
"label": "f : int -> int -> int -> int",
50-
"parameters": [
51-
{
52-
"label": [
53-
4,
54-
7
55-
]
56-
},
57-
{
58-
"label": [
59-
11,
60-
14
61-
]
62-
},
63-
{
64-
"label": [
65-
18,
66-
21
67-
]
68-
}
69-
]
70-
}
71-
],
72-
"activeParameter": 0,
73-
"activeSignature": 0
74-
},
45+
"value": {},
7546
"notifications": []
7647
}

0 commit comments

Comments
 (0)