• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package org.jetbrains.dokka.javadoc
2 
3 import com.sun.javadoc.SourcePosition
4 import org.jetbrains.dokka.DocumentationNode
5 import org.jetbrains.dokka.NodeKind
6 import java.io.File
7 
8 class SourcePositionAdapter(val docNode: DocumentationNode) : SourcePosition {
9 
<lambda>null10     private val sourcePositionParts: List<String> by lazy {
11         docNode.details(NodeKind.SourcePosition).firstOrNull()?.name?.split(":") ?: emptyList()
12     }
13 
filenull14     override fun file(): File? = if (sourcePositionParts.isEmpty()) null else File(sourcePositionParts[0])
15 
16     override fun line(): Int = sourcePositionParts.getOrNull(1)?.toInt() ?: -1
17 
18     override fun column(): Int = sourcePositionParts.getOrNull(2)?.toInt() ?: -1
19 }
20