Skip to content

Commit

Permalink
Add usage of the DocumentationAppender
Browse files Browse the repository at this point in the history
  • Loading branch information
theEvilReaper committed Jan 15, 2024
1 parent 5026264 commit ea94c85
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package net.theevilreaper.dartpoet.code.writer

import net.theevilreaper.dartpoet.DartModifier.*
import net.theevilreaper.dartpoet.code.CodeBlock
import net.theevilreaper.dartpoet.code.CodeWriter
import net.theevilreaper.dartpoet.code.Writeable
import net.theevilreaper.dartpoet.code.*
import net.theevilreaper.dartpoet.code.DocumentationAppender
import net.theevilreaper.dartpoet.code.emitParameters
import net.theevilreaper.dartpoet.function.FunctionSpec
import net.theevilreaper.dartpoet.parameter.ParameterSpec
Expand All @@ -14,12 +13,10 @@ import net.theevilreaper.dartpoet.util.SEMICOLON
import net.theevilreaper.dartpoet.util.SPACE
import net.theevilreaper.dartpoet.util.toImmutableSet

internal class FunctionWriter : Writeable<FunctionSpec> {
internal class FunctionWriter : Writeable<FunctionSpec>, DocumentationAppender {

override fun write(spec: FunctionSpec, writer: CodeWriter) {
if (spec.hasDocs) {
spec.docs.forEach { writer.emitDoc(it) }
}
emitDocumentation(spec.docs, writer)

if (spec.annotation.isNotEmpty()) {
spec.annotation.forEach { it.write(writer) }
Expand Down

0 comments on commit ea94c85

Please sign in to comment.