typescriptpoet icon indicating copy to clipboard operation
typescriptpoet copied to clipboard

Fix CodeBlock of handle CodeBlock args wrong

Open Legion2 opened this issue 8 months ago • 0 comments

If CodeBlock is added to other CodeBlock via %L template parameter, toString() is used on the first CodeBlock and then added to second CodeBlock, this makes it impossible for the second code block to know the used symbols and imports required by the first CodeBlock und they are not imported in the file when rendered with FileSpec. In the CodeWriter the %L is handled correctly, however the CodeBlock arguments are converted to strings in CodeBlock already.

https://github.com/outfoxx/typescriptpoet/blob/62d7d4b276b6039bd04729ddb135a9428e61b03e/src/main/java/io/outfoxx/typescriptpoet/CodeBlock.kt#L339

Legion2 avatar Oct 19 '23 15:10 Legion2