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

Overhaul JavaTemplate documentation #202

Open
knutwannheden opened this issue Jul 11, 2023 · 3 comments
Open

Overhaul JavaTemplate documentation #202

knutwannheden opened this issue Jul 11, 2023 · 3 comments
Labels
blocked When an issue can't be worked on right now documentation Improvements or additions to documentation enhancement New feature or request

Comments

@knutwannheden
Copy link
Contributor

As of OpenRewrite 8 the JavaTemplate API changed quite a bit and also introduces the distinction of context-free and -sensitive templates. This calls for an overhaul of the documentation on this topic.

@knutwannheden knutwannheden added documentation Improvements or additions to documentation enhancement New feature or request labels Jul 11, 2023
@mike-solomon
Copy link
Contributor

This issue requires the help of someone on the dev team to read through the JavaTemplate doc and then provide information on what needs to change. Tagging @sambsnyd for potential prioritization / help in the future. Marking this as blocked for now.

@mike-solomon mike-solomon added the blocked When an issue can't be worked on right now label Jul 12, 2023
@joanvr joanvr moved this to Backlog in OpenRewrite Jul 17, 2023
@joanvr
Copy link

joanvr commented Aug 2, 2023

I'm going to collect in this comment the bits that I found during support or using the documentation that needs changes:

  • Here it still mentions J.withTemplate although it no longer exists. It should be replaced with template.apply, but not sure the exact pharsing:
    Once an instance of the template has been created it can be applied to an LST element with the method `J.withTemplate()`. This example visitor uses a template to replace all method invocations of `countLetters(String)` with `withString(String).length()`:

@mike-solomon
Copy link
Contributor

As part of this - we should make sure to include information about context sensitivity. Related slack post

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked When an issue can't be worked on right now documentation Improvements or additions to documentation enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

3 participants