Skip to content

Commit

Permalink
Fix formatting and ReturnCount error
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-w committed Jan 18, 2024
1 parent d6c5afa commit d09344d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ import org.jetbrains.kotlin.psi.KtDotQualifiedExpression
import org.jetbrains.kotlin.psi.KtNameReferenceExpression
import org.jetbrains.kotlin.psi.psiUtil.startOffset
import org.javacs.kt.LOG
import kotlin.math.abs

fun fetchSignatureHelpAt(file: CompiledFile, cursor: Int): SignatureHelp? {
val (signatures, activeSignature, activeParameter) = getSignatureTriplet(file, cursor) ?: return nullResult("No call around ${file.describePosition(cursor)}")
return SignatureHelp(signatures, activeSignature,activeParameter)
return SignatureHelp(signatures, activeSignature, activeParameter)
}

/**
Expand All @@ -42,6 +41,7 @@ fun getDocString(file: CompiledFile, cursor: Int): String {
}

// TODO better function name?
@Suppress("ReturnCount")
private fun getSignatureTriplet(file: CompiledFile, cursor: Int): Triple<List<SignatureInformation>, Int?, Int?>? {
val call = file.parseAtPoint(cursor)?.findParent<KtCallExpression>() ?: return null
val candidates = candidates(call, file)
Expand Down Expand Up @@ -127,6 +127,7 @@ private fun isCompatibleWith(call: KtCallExpression, candidate: CallableDescript
return true
}

@Suppress("ReturnCount")
private fun activeParameter(call: KtCallExpression, cursor: Int): Int? {
val args = call.valueArgumentList ?: return null
val text = args.text
Expand Down

0 comments on commit d09344d

Please sign in to comment.