-
-
Notifications
You must be signed in to change notification settings - Fork 352
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
feature: add support for pretty-printing Java 15 text blocks #3664
Conversation
Todo:
|
The package However, I am taking a look at how to solve this.. |
JLS 3.10.6 stats the grammar for textblocks |
…creation of TextBlock element in model
Thank you very much for the reply. Actually my question had been that I am not able to get the token source from a call to getSource in the first place. For example, if the textblock was:
Then calling But the issue has been resolved now in the latest commit. The stringLiteral that was being passed to the visitor was actually an instanceof TextBlock from jdt ast, and I checked it using instanceof. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really cool PR! LGTM but a minor comment to fix.
public CtTextBlock createTextBlock(String value) { | ||
CtTextBlock textblock = factory.Core().createTextBlock(); | ||
textblock.setValue(value); | ||
// TODO set textblock.setType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix or remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for pointing out. I have made some changes. Kindly give them a look.
I believe that with this PR, Java 15 support in Spoon is complete. Relevant changes in the webpage/documentation can be made either now, or upon the next release. |
Thanks @LakshyAAAgrawal impressive work. |
Thanks a lot for merging @monperrus |
Implement CtTextBlock class and add factories
Closes #3605