0

When using PhpStorm on Ubuntu - I think I didn't have this problem under OS X - and copy some text, than PhpStorm somehow adds whitespaces to the line. I can see this, because I've got phpcs installed which tells me that x whitespaces are found at the end of line. I already set in the settings that PhpStorm should remove unnecessary whitespaces when saving, but I don't know why it generates it to begin with.

The same goes, when I'm extending a class with auto completion for example: class Foo extends Bar{whitespace} PhpStorm would now add an unneeded whitespace after the Bar and I have to remove it manually all the time. Same goes for importing classes (also when extending), PhpStorm always puts them directly under the namespace but I want it to have one line inbetween, because of PSR-2. Any ideas?

LazyOne
  • 158,824
  • 45
  • 388
  • 391
Musterknabe
  • 5,763
  • 14
  • 61
  • 117
  • Whitespace added when you complete the item via code completion is normal behaviour -- I do have the same for `class Foo extends Bar{whitespace}` case. For me it's expected behaviour (in this particular case) -- allows you to enter `implements` or `{` without the need to type ` ` character; and if you type such stuff on separate line -- space will be trimmed on Save. No real idea about adding spaces on copy -- where it's added -- at the end or in the front? Try changing "Reformat on Paste" option behaviour (hint: Settings screen has a search box). – LazyOne Sep 28 '16 at 08:28
  • Yeah, but when I write `implements` I add the whitespace anyway, and since I use `PSR-2` my brackets come on a new line so it is rather useless :p But thanks! I already set the settings so I have a space between `namespace` and `use` – Musterknabe Sep 28 '16 at 10:08

0 Answers0