-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
Support for text blocks in Escapers #7421
Comments
(previous request in another thread, which I had forgotten about)
The literal And conveniently, none of that prevents us from offering
I will make the usual comment for the record that typical users will want something more like JavaPoet to perform their source-code generation at a higher level. (We try to steer users away from our HTML escapers on similar grounds. We should do the same for our source-code escapers.) [edit: Not that I can tell whether they have support for text blocks. And of course there is a relatively less pressing need for text blocks in generated code, which may be read by humans less frequently than Error Prone's test data.] Also, by the way, |
@graememorgan just pointed out to me that that is not actually true :) But what fun would it have been to type "guava.dev/escaper" into a browser when I could instead have been looking up bugs from 15 years ago? I notice now that that old bug even says only that the requested CDATA escaper "isn't really an Escaper in the CharEscaper sense." Now, it looks like that concern dates to the days when |
Hi I would like to complete this issue. Can you plz assign it to me? |
API(s)
How do you want it to be improved?
There are existing
Escaper
s that support escaping aString
to include in Java source code as a quoted string literal.What I'd really like is an
Escaper
which escapes appropriately for Java 15 text blocks.Why do we need it to be improved?
"Need" is a strong word! We have a string literal escaper; I think an escaper for text block literals is a natural (if low-priority) extension given the new feature.
Example
Current Behavior
I could use
javaCharEscaper()
and put that in a text block.Desired Behavior
I'd like an escaper that makes better use of the functionality of text blocks to produce more readable source.
Concrete Use Cases
I was writing an ErrorProne check that google-java-formats code written in text blocks.
Checklist
I agree to follow the code of conduct.
I have read and understood the contribution guidelines.
I have read and understood Guava's philosophy, and I strongly believe that this proposal aligns with it.
The text was updated successfully, but these errors were encountered: