Complete Statement bug?
Hi folks,
I can't find workaround with Complete Statement feature. I like this feature very much but I facing this kind of a problem. If my code begins intended with TAB, then after using this feature hitting CTRL+SHIFT+ENTER it removes all tabs from the left side. eg:
any ideas how to stop it?
thanks
if (isset($_GET['test']))
becomes
if (isset($_GET['test'])) {
}
请先登录再写评论。
It was a feature that was requested a while ago: https://youtrack.jetbrains.com/issue/WI-24317
Basically, PhpStorm puts the completed line to the proper indent position.
If you have this code:
The result would be:
Similarly, if you have something like this:
Complete Statement will result in:
Because the line wasn't indented properly originally.
Thanks, but what if I used to write code from intended line and don't like to start it from the edge?
We don't support arbitrary indent levels, unfortunately. The best workaround I can offer you is that you enable
Settings | Editor | Code Style | PHP | Tabs and Indents | Indent code in PHP tags, so that the code was indented to your liking automatically.