-
Notifications
You must be signed in to change notification settings - Fork 47
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
Automated Conversion from Old String Concatenations to String Templates #116
Comments
Hi Benjamin, yes, that would indeed be a nice cleanup rule! The idea was already raised in #36 (point 10), but I think this is worth a dedicated issue! Kind regards, |
Hi Benjamin, this idea … DATA(message) = `Return code ` && code && ` with message ` && text.
DATA(message) = |Return code { code } with message { text }|. … should be implemented now with the new cleanup rule "Use string templates to assemble text", which was just released as part of version 1.15.0! However, we could still keep this issue open to check about Kind regards, |
Great to see, thank you. What does the option "Always convert text literals in concatenations" do exactly? This option isn't represented by the example. |
Hi ConjuringCoffee, if you use "Embed … if result is shorter" (but NOT equal), then nothing is changed: So, "Always convert text literals …" really has this notion of "even convert in cases in which the result is not shorter, but equally long" (while unchecking the option does not necessarily prevent text literals from being converted). Kind regards, |
Hello Jörg-Michael,
The way we currently concatenate strings is quite inconsistent and therefore not always easily readable. Sometimes we use the old concatenations, and other times we use string templates. How about implementing a rule to automatically convert old string concatenations to string templates?
For instance, this code:
DATA(message) =
Return code
&& code &&with message
&& text.Could be converted to:
DATA(message) = |Return code { code } with message { text }|.
Or even:
CONCATENATE material plant sales_order INTO item SEPARATED BY '-'.
to:
item = |{ material }-{ plant }-{ sales_order }|.
What do you think?
Best regards,
Ben
The text was updated successfully, but these errors were encountered: