aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/Formats
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2016-01-08 18:06:06 +0100
committerDmitry Jemerov <yole@jetbrains.com>2016-01-08 18:06:06 +0100
commit7fb4d948893db3332fcb7610261300cc5b856cff (patch)
tree23edf3361bb8c50a9ec1281c18c9c23136028744 /core/src/main/kotlin/Formats
parentb3ce9a8eed32523c3ef2ee1ce186434bd14a6e64 (diff)
downloaddokka-7fb4d948893db3332fcb7610261300cc5b856cff.tar.gz
dokka-7fb4d948893db3332fcb7610261300cc5b856cff.tar.bz2
dokka-7fb4d948893db3332fcb7610261300cc5b856cff.zip
rewrite propagation of extension functions to subclasses to handle shadowing and applicability more correctly
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
-}