aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/Formats
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/main/kotlin/Formats')
-rw-r--r--core/src/main/kotlin/Formats/StructuredFormatService.kt17
1 files changed, 1 insertions, 16 deletions
diff --git a/core/src/main/kotlin/Formats/StructuredFormatService.kt b/core/src/main/kotlin/Formats/StructuredFormatService.kt
index 01f38605..f23c27fa 100644
--- a/core/src/main/kotlin/Formats/StructuredFormatService.kt
+++ b/core/src/main/kotlin/Formats/StructuredFormatService.kt
@@ -309,7 +309,7 @@ abstract class StructuredFormatService(locationService: LocationService,
)
})
- val allExtensions = collectAllExtensions(node)
+ val allExtensions = node.extensions
appendSection("Extension Properties", allExtensions.filter { it.kind == NodeKind.Property })
appendSection("Extension Functions", allExtensions.filter { it.kind == NodeKind.Function })
appendSection("Companion Object Extension Properties", allExtensions.filter { it.kind == NodeKind.CompanionObjectProperty })
@@ -379,18 +379,3 @@ abstract class StructuredFormatService(locationService: LocationService,
}
}
}
-
-private fun collectAllExtensions(node: DocumentationNode): Collection<DocumentationNode> {
- val result = LinkedHashSet<DocumentationNode>()
- val visited = hashSetOf<DocumentationNode>()
-
- fun collect(node: DocumentationNode) {
- if (!visited.add(node)) return
- result.addAll(node.extensions)
- node.references(RefKind.Superclass).forEach { collect(it.to) }
- }
-
- collect(node)
-
- return result
-}