parameterIndex¶
fun PsiElement.parameterIndex(): Int
Returns the index of this parameter within its own parameter list (Kotlin or Java), or -1 if it is not a parameter.
Ordinary parameters and context parameters live in separate lists, each indexed from zero, so the returned index does not correspond to the parameter's position in the JVM method signature or any combined ordering.
Example:¶
Given the parameters in:
logger.parameterIndex() and first.parameterIndex() both return 0; transaction.parameterIndex() and second.parameterIndex() both return 1.