From 5ad13bab588b1cd68156bb29e257e02023902a33 Mon Sep 17 00:00:00 2001 From: Knut Wannheden Date: Tue, 15 Aug 2023 14:21:37 +0200 Subject: [PATCH] Add `TEMPLATE_INTERNAL_IMPORTS` imports --- .../template/KotlinBlockStatementTemplateGenerator.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/org/openrewrite/kotlin/internal/template/KotlinBlockStatementTemplateGenerator.java b/src/main/java/org/openrewrite/kotlin/internal/template/KotlinBlockStatementTemplateGenerator.java index 6e51680b6..9070cc700 100644 --- a/src/main/java/org/openrewrite/kotlin/internal/template/KotlinBlockStatementTemplateGenerator.java +++ b/src/main/java/org/openrewrite/kotlin/internal/template/KotlinBlockStatementTemplateGenerator.java @@ -39,5 +39,10 @@ protected void contextFreeTemplate(Cursor cursor, J j, StringBuilder before, Str before.append("var o : Object = "); after.append(";"); after.append("\n}"); + + before.insert(0, TEMPLATE_INTERNAL_IMPORTS); + for (String anImport : imports) { + before.insert(0, anImport); + } } }