diff options
-rw-r--r-- | src/Formats/StructuredFormatService.kt | 7 | ||||
-rw-r--r-- | test/data/format/enumClass.kt | 4 | ||||
-rw-r--r-- | test/data/format/enumClass.md | 25 | ||||
-rw-r--r-- | test/src/format/MarkdownFormatTest.kt | 6 |
4 files changed, 40 insertions, 2 deletions
diff --git a/src/Formats/StructuredFormatService.kt b/src/Formats/StructuredFormatService.kt index 977d81d0..49a7c96b 100644 --- a/src/Formats/StructuredFormatService.kt +++ b/src/Formats/StructuredFormatService.kt @@ -216,6 +216,7 @@ public abstract class StructuredFormatService(val locationService: LocationServi appendSection(location, "Class Object Properties", node.members(DocumentationNode.Kind.ClassObjectProperty), node, to) appendSection(location, "Class Object Functions", node.members(DocumentationNode.Kind.ClassObjectFunction), node, to) appendSection(location, "Accessors", node.members(DocumentationNode.Kind.PropertyAccessor), node, to) + appendSection(location, "Enum Values", node.members(DocumentationNode.Kind.EnumItem), node, to) appendSection(location, "Other members", node.members.filter { it.kind !in setOf( DocumentationNode.Kind.Class, @@ -230,11 +231,13 @@ public abstract class StructuredFormatService(val locationService: LocationServi DocumentationNode.Kind.PropertyAccessor, DocumentationNode.Kind.ClassObjectProperty, DocumentationNode.Kind.ClassObjectFunction, - DocumentationNode.Kind.ExternalClass + DocumentationNode.Kind.ExternalClass, + DocumentationNode.Kind.EnumItem ) }, node, to) appendSection(location, "Extensions", node.extensions, node, to) - appendSection(location, "Inheritors", node.inheritors, node, to) + appendSection(location, "Inheritors", + node.inheritors.filter { it.kind != DocumentationNode.Kind.EnumItem }, node, to) appendSection(location, "Links", node.links, node, to) } diff --git a/test/data/format/enumClass.kt b/test/data/format/enumClass.kt new file mode 100644 index 00000000..5988c644 --- /dev/null +++ b/test/data/format/enumClass.kt @@ -0,0 +1,4 @@ +public enum class InlineOption { + LOCAL_CONTINUE_AND_BREAK + ONLY_LOCAL_RETURN +} diff --git a/test/data/format/enumClass.md b/test/data/format/enumClass.md new file mode 100644 index 00000000..1f2df115 --- /dev/null +++ b/test/data/format/enumClass.md @@ -0,0 +1,25 @@ +[test](out.md) / [](out.md) / [InlineOption](out.md) + + +# InlineOption + + +``` +public enum class InlineOption +``` + + + + +### Constructors + + +| [<init>](out.md) | `private InlineOption()` | + + +### Enum Values + + +| [LOCAL_CONTINUE_AND_BREAK](out.md) | `public enum val LOCAL_CONTINUE_AND_BREAK : [InlineOption](out.md)` | +| [ONLY_LOCAL_RETURN](out.md) | `public enum val ONLY_LOCAL_RETURN : [InlineOption](out.md)` | + diff --git a/test/src/format/MarkdownFormatTest.kt b/test/src/format/MarkdownFormatTest.kt index 3d32743f..8cb6091f 100644 --- a/test/src/format/MarkdownFormatTest.kt +++ b/test/src/format/MarkdownFormatTest.kt @@ -46,4 +46,10 @@ public class MarkdownFormatTest { markdownService.appendNodes(tempLocation, output, model.members.single().members) } } + + Test fun enumClass() { + verifyOutput("test/data/format/enumClass.kt", ".md") { model, output -> + markdownService.appendNodes(tempLocation, output, model.members.single().members) + } + } } |