Skip to content

Commit 88597dd

Browse files
committed
Most likely fixed string out of bounds exception, need to test more
1 parent cdf496c commit 88597dd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/kotlin/org/javacs/kt/signaturehelp/signatureHelp.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ private fun isCompatibleWith(call: KtCallExpression, candidate: CallableDescript
107107
private fun activeParameter(call: KtCallExpression, cursor: Int): Int {
108108
val args = call.valueArgumentList ?: return -1
109109
val text = args.text
110-
val beforeCursor = text.subSequence(0, cursor - args.textRange.startOffset)
110+
if (text.length == 2)
111+
return 0
112+
val beforeCursor = text.subSequence(0, args.textRange.startOffset - cursor)
111113

112114
return beforeCursor.count { it == ','}
113115
}

0 commit comments

Comments
 (0)