Reformatting/Code Style doesn't do anything

I am just starting with PhpStorm and duplicated the default PHP code style to my custom scheme yesterday. All went well and looked good.

But today it stopped working completely for the PHP styles. Neither the preview changes, nor my code when I press CMD + OPTION + L. It says everything is properly formatted. 

When I change something in the settings it doesn't reflect to what I change. It doesn't work in the default scheme as well. However HTML works and when I change something the preview pane blinks and reflect my edits.

Here is what I exported from the code styles settings: https://www.dropbox.com/s/48ndjppkjpmwkhg/My%20Formatting.xml?dl=0

6 comments

I tried to import your XML file and, at least, a preview is working.

Could you please also share an example of non-formatted code that you are trying to reformat, so I could check it on my installation with your settings applied?

0

Sure, here is the small demo code I am using:

https://gist.githubusercontent.com/suntrop/cc842871c5e95b64aa2d75e3aa3b2656/raw/7e2efea747be031c77b56624aa72f0f52c1240e8/phpstormtestcode

Here you can see nothing changes, when I click the checkboxes. The first day I tried PhpStorm I saw changes take effect immediately. It still works on other languages, but not PHP.

 

It says, nothing has to be reformatted. But I would assume spaces will convert to tabs, indention will be corrected, the { will move to their proper position etc.

0

Please disable all custom plugins at Preferences | Plugins | Installed | Downloaded, restart PhpStorm and check if the issue persists. If it does, probably it makes sense to try starting with an empty PhpStorm config - rename the ~/Library/Preferences/PhpStorm2018.3 folder, start PhpStorm not importing settings, open the problematic project and check again.

I really expect the issue to be gone, as it's not reproducible on two support engineers' machines.

0

I only had "String Manipulation" installed, but disabling didn't helped. But I noticed when I create a new project and open the Settings it works again. So it must be related to the project itself?!

0

Must be. If it's acceptable for you, you can purge the .idea folder so that the project settings were reset.

Or, you can first try removing just codeStyleSettings.xml.

0

It seems to be working now, after I delete the .idea folder. Hope this is not a common problem in PhpStrom 

0

Please sign in to leave a comment.