问题
When my cursor is after an open quote in a SQL statement in an IntelliJ database console and I press Enter, it closes the quote on the current line and adds a concatenation symbol with an open quote on the newline.
I disabled formatting the SQL code style settings but that didn't fix it for me.
UPDATE blah SET blah2 = 'something<pressed enter>' ||
'<argh!>...';
Is there a way to disable this autoformatting?
回答1:
This request was addressed in 2017.1 version, as a result, Insert string concatenation on Enter setting was added specifically for SQL:
回答2:
This can be archived since IntelliJ 13. You simply need to wrap your code with
// @formatter:off
your code goes here
// @formatter:on
Since IntelliJ Idea 15-16(pardon if i'm wrong), you can also make permanent set up by Preferences > Editor > Code Style option
Hope it helps
来源:https://stackoverflow.com/questions/42864012/how-do-i-stop-sql-splitting-string-literals-when-i-press-enter-in-datagrip-or-in