Community
Participate
Working Groups
Build Identifier: Eclipse for PHP Developers 3.0.2.v2011102768 When typing PHP code and pressing enter inside round parentheses, the new line is indented twice instead of one. Examples (indenting with tabs, tab size is 4): --- Expected: $this->method($param1, $param2, $param3, $param4); Actual: $this->method($param1, $param2, $param3, $param4); --- Expected: $anArray = array( 'key' => 'value' ); Actual: $anArray = array( 'key' => 'value' // ^-- cursor jumps here (two tabs). ); --- Expected: if ($isThis && $isThat) { // Tab size is 4 } Actual: if ($isThis && $isThat) { // Tab size is 4 } Reproducible: Always Steps to Reproduce: Indentation related settings are: General/Editors/Text Editors: Displayed tab width: 4 PHP/Code Style/Formatter: Tab policy: Tabs No project specific settings are set. Same happens with using spaces as tab policy.
tested on Eclipse for PHP Developers 3.0.2.v2011102768
This can be changed through main menu: Window->Preferences->PHP->Code Style->Formatter:Default indentation for array initializers:.
Created attachment 218145 [details] Eclipse for PHP Developers Formatter settings panel
Sorry for reopening this, but my problem is not solved with the answer above. Please check the screenshot I added. I don't have an option like 'Default indentation for array initializers', but only a box to switch between using tabs or spaces for indentation, and setting indentation size, which is grayed out when using Tabs. If this is not a bug, but a lack of feature in this version of Eclipse I am using, please inform me what I should install in order to get the required function. Thank you.
Everything works correctly with current nightly build.
There is a new and much complex formatter. Now those options can be changed Indentation in Line wrapping tabs. I verified and changing Default indentation for array initializers and Default indentation for wrapped lines from 2 to 1 makes exactly what you expect. Closing