Sometimes you have a text in a Java String literal, which you want to copy-paste somewhere else, as if the text was printed. For example, you have the following Java String literal:
"SELECT * \n"
+ "FROM emp\n"
+ "JOIN dept USING (deptno)";
You want to convert it to:
SELECT *
FROM emp
JOIN dept USING (deptno)
We often have very long queries or pieces of HTML in String literals. Conversion in both ways would be useful, I don't know of another way how to do it automatically.
Unwrapping should fail if there's anything else other than a single + character and whitespace between individual string literals. Escaped characters should be unescaped.
The usefulness will be slightly reduced after Java 15 which introduced multi-line string literals, I suppose IntelliJ has a conversion to this literal type, but many projects are stuck with older versions (mine are too).
Perhaps the current Quote/unquote feature can be replaced with this behavior, it's pretty useless IMO, it doesn't even escape/unescape the characters within the text.
The conversion might be useful for other languages too, but it should not be determined by the file type in the editor - most often I copy SQL queries to SQL console where I want to unwrap.
Sometimes you have a text in a Java String literal, which you want to copy-paste somewhere else, as if the text was printed. For example, you have the following Java String literal:
You want to convert it to:
We often have very long queries or pieces of HTML in String literals. Conversion in both ways would be useful, I don't know of another way how to do it automatically.
Unwrapping should fail if there's anything else other than a single
+character and whitespace between individual string literals. Escaped characters should be unescaped.The usefulness will be slightly reduced after Java 15 which introduced multi-line string literals, I suppose IntelliJ has a conversion to this literal type, but many projects are stuck with older versions (mine are too).
Perhaps the current Quote/unquote feature can be replaced with this behavior, it's pretty useless IMO, it doesn't even escape/unescape the characters within the text.
The conversion might be useful for other languages too, but it should not be determined by the file type in the editor - most often I copy SQL queries to SQL console where I want to unwrap.