@@ -42,18 +42,16 @@ object Signatures {
4242 /**
4343 * Extract (current parameter index, function index, functions) out of a method call.
4444 *
45- * @param path The path to the function starting with closest one to `span`
45+ * @param enclosingApply Enclosing function application
4646 * @param span The position of the cursor
4747 * @return A triple containing the index of the parameter being edited, the index of the function
4848 * being called, the list of overloads of this function).
4949 */
50- def callInfo (path : List [tpd.Tree ], span : Span )(using Context ): (Int , Int , List [SingleDenotation ]) =
51- path match {
52- case UnApply (fun, _, patterns) :: _ => callInfo(span, patterns, fun, Signatures .countParams(fun))
53- case Apply (fun, params) :: _ => callInfo(span, params, fun, Signatures .countParams(fun))
54- case _ =>
55- (0 , 0 , Nil )
56- }
50+ def callInfo (enclosingApply : Option [tpd.Tree ], span : Span )(using Context ): (Int , Int , List [SingleDenotation ]) =
51+ enclosingApply.map {
52+ case UnApply (fun, _, patterns) => callInfo(span, patterns, fun, Signatures .countParams(fun))
53+ case Apply (fun, params) => callInfo(span, params, fun, Signatures .countParams(fun))
54+ }.getOrElse((0 , 0 , Nil ))
5755
5856 def callInfo (
5957 span : Span ,
0 commit comments