Questions before buying PhpStorm
I want to buy a new IDE soon and therefore I have to decide between Zend Studio and your product, PhpStorm. Currently I am testing PhpStorm 3 (unstable).
Code formatting is a very important feature for me and so I have a few questions:
- PhpStorm always adds a new line to the end of the file - even if there is a closing ?>-Tag. Is there any possibility to turn this behaviour off?
- I want to indent empty lines equal to previous line, is that possible?
- How can I indent empty lines in phpDoc comments by one single space?
Thanks in advance.
- Sebastian
Please sign in to leave a comment.
Hi soettl,
1) File | Settings | Editor | Ensure blank line before end of the file on Save
2) & 3) Not sure what you mean here. But I'm not using formatter that much so I possibly just missing such existing setting somewhere. In any case -- please provide code snippet explaining how it works right now & how it should work instead -- maybe it's a bug (if such setting does exist).
I have the same problem with the whitespaces and automatic reformatting, I just tested and this behaviour is a bug when not using tab characters for indenting.
When tabs are not used and phpStorm saves a file that has "empty" rows (ie. rows that have only spaces), the spaces are stripped out.
For example I have this LESS-file:
The empty row before the row starting div declaration has now four spaces but when saving, the row goes completely empty. If tab character is used, it remains correctly.
This is a major pain in the ass because we have almost 2k rows in our main LESS-file and everytime I try to commit my changes, all the empty rows show up as modifications in VCS because all of the other developers have working editors which add/handle spaces correctly. ;)
Did you try to go to preferences->Editor- and there under general you have option: Strip trailing spaces on Save: None or just modiied lines ?
Regards
Hi Andriy,
thanks for your reply.
The code formatter does always add a new line before the closing ?>-Tag, not at the end of the file.
I want to format my code this way:
This is how it looks like now:
Is that possible in PhpStorm 3?
- Sebastian
Hi soettl,
Thanks for clarification -- now I understand you you meant.
Not exactly -- rather "after the class" I would say -- if you add some php command after class but before such closing tag, new line will not be added before the tag but will be before that line (after the class). Possibly it's a bug (I'm not sure) -- I have played with different options and always have the same result. I think it's worth reporting it as a bug on Issue Tracker (if it's not a bug, then at least you should have proper clarification on this).
In current EAP build -- no -- at least I was unable to acheive such results. I would recommend submitting feature requests (1 ticket per option -- it's easier to track and implementing in this way for devs) on Issue Tracker: http://youtrack.jetbrains.net/issues/WI
I already opened a ticket for this issue. While the correct functionality can apparently be achieved as it is (2.1.5) it is still inconsistent depending on does one use tab characters or spaces for indentation.
http://youtrack.jetbrains.net/issue/WI-7985
Hi Andriy,
thanks for your reply, here are the links to the issues:
- Sebastian