Benni
09/07/2022, 8:38 PMorg.jetbrains.kotlin.psi.KtNamedFunction
. Anyone know how I can get the line number in which the function resides. I can get the location with startOffsetSkippingComments
and I assume I could calculate it myself by reading the file, but I was wondering, if there might be a different way.alp
09/07/2022, 9:01 PMPsiDiagnosticUtils.getLineAndColumnInPsiFile
for getting line numbers:
internal fun PsiElement.lineAndColumn(): PsiDiagnosticUtils.LineAndColumn {
return DiagnosticUtils.getLineAndColumnInPsiFile(containingFile, textRange) // wrap this in try catch