PHP indents stuck on 4 spaces
I have all my indentation settings for PHP set to 2 spaces, and I have indentation auto-detection turned off, but PHP still always uses 4 spaces, and it shows in the bottom right. I have no .editorconfig either. I've searched everywhere and tried every solution, including fully reinstalling PHPStorm.
Only other thing I can think of is a broken settings file somewhere, but I want to confirm that there's no other solution before I fully wipe my settings.
Please sign in to leave a comment.
Is there any chance that affected files have mixed HTML/PHP code? If this is the case, you might be experiencing the following issue:
https://youtrack.jetbrains.com/issue/WI-59720/HTML-indent-settings-are-used-in-PHP-HTML-mixed-code
Hi,
Is it reproducible on new files/new project too?
Would it be possible to share your code style export? (Settings/Preferences | Editor | Code Style > Scheme > Export > XML)
Hmm, yeah okay it's only happening in this project.
This is my Default code style export:
The Project one was empty.
Thank you for your reply.
Does it happen for all files in this specific project including newly created ones too?
Could you please share the affected project `.idea` folder? You may do that privately via our JetBrains Upload services (just let me know the upload id):
https://uploads.jetbrains.com
I'm having the same problem with just one project and it is triggered every time when I create a new file. If I close the IDE and open it again, it shows and uses the correct indent - 2 spaces and that's until the next new file.
In my case it's JavaScript - React JSX and it's 100% reproducible. Also, this was introduced in some of the last 2-3 updates of the IDE.
Do you have an `.editorconfig` file in this specific project?