Break String Across Two Lines
Hi all,
This is a really, really basic question so I apologize in advance but I just can't find the answer.
I quite often write SQL into the code like most people and the command can become quite long, according to the coding standards (correct me if I'm wrong), it's better to hard wrap these long lines for easier reading.
Coming from Netbeans if you were inside the following example and press <ENTER> at the ^ point
$sql = "SELECT XXXXX^"
Then the system will automatically break the comment across two lines to make:
$sql = "SELECT XXXXX" .
. "^"
Then you can carry on typing without worrying about concatenation, additionally you could right click the string and copy the full string joined together (great for copying into phpMyAdmin).
When I press ENTER in Storm it just makes a variable with a newline in it, and I'm sure this can probably be configured somewhere.
Many thanks and sorry for my stupidity.
请先登录再写评论。
Hi there,
1. For what language it is required. I assume it's PHP? If so -- why not use HEREDOC? Much better and convenient:
2. Have you tried [Ctrl+Enter]? Seems to work on my computer in PHP (not sure if default or via some plugin).
P.S. May be language-dependent implementation (available in one and not in another)
3. Try pressing [Alt+Enter] while having caret in such place -- you should see list of Intentions / Quick Fixes.
This is what I see (PhpStorm 2016.3.3; few custom plugins installed) -- the highlighted action does a bit different thing (no new line) but similar to requested:
Many thanks, I might go for a heredoc, the CTRL+ENTER did work after a restarted the IDE, thought I was going crazy.
Thanks again.