Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add KotlinTemplate #219

Merged
merged 14 commits into from
Mar 5, 2024
Merged

Add KotlinTemplate #219

merged 14 commits into from
Mar 5, 2024

Conversation

knutwannheden
Copy link
Contributor

The KotlinTemplate class in this PR is an extension of JavaTemplate and replaces many of its internals so that JavaTemplate can be used to parse and template Kotlin code.

As a demo have a look at ReplaceCharToIntWithCode.

The `KotlinTemplate` class in this PR is an extension of `JavaTemplate` and replaces many of its internals so that `JavaTemplate` can be used to parse and template Kotlin code.

As a demo have a look at `ReplaceCharToIntWithCode`.
@knutwannheden knutwannheden linked an issue Aug 17, 2023 that may be closed by this pull request
@knutwannheden knutwannheden added the enhancement New feature or request label Aug 22, 2023
@knutwannheden knutwannheden self-assigned this Aug 22, 2023
@kunli2
Copy link
Contributor

kunli2 commented Dec 6, 2023

note: this PR depends on openrewrite/rewrite#3475

@zacscoding
Copy link
Contributor

When will this feature be supported 👀 ?

*/
package org.openrewrite.kotlin;

import org.junit.jupiter.api.Test;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Test;
import org.openrewrite.DocumentExample;

import static org.openrewrite.kotlin.Assertions.kotlin;
import static org.openrewrite.test.RewriteTest.toRecipe;

public class KotlinTemplateMatchTest implements RewriteTest {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public class KotlinTemplateMatchTest implements RewriteTest {
class KotlinTemplateMatchTest implements RewriteTest {
@DocumentExample

@knutwannheden knutwannheden marked this pull request as ready for review March 5, 2024 08:35
@knutwannheden knutwannheden merged commit 2bdf2c6 into main Mar 5, 2024
2 checks passed
@knutwannheden knutwannheden deleted the kotlintemplate branch March 5, 2024 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request parser-kotlin
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

KotlinTemplate
4 participants