Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 370963 - Double indentation inside round parentheses
Summary: Double indentation inside round parentheses
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: PHP UI CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-08 10:22 EST by Abrahala Gabra CLA
Modified: 2020-05-14 11:28 EDT (History)
3 users (show)

See Also:


Attachments
Eclipse for PHP Developers Formatter settings panel (70.43 KB, image/jpeg)
2012-07-02 06:06 EDT, Abrahala Gabra CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Abrahala Gabra CLA 2012-02-08 10:22:02 EST
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.
Comment 1 Abrahala Gabra CLA 2012-02-08 10:27:11 EST
tested on Eclipse for PHP Developers 3.0.2.v2011102768
Comment 2 Zhongwei Zhao CLA 2012-05-02 01:30:43 EDT
This can be changed through main menu:
Window->Preferences->PHP->Code Style->Formatter:Default indentation for array initializers:.
Comment 3 Abrahala Gabra CLA 2012-07-02 06:06:47 EDT
Created attachment 218145 [details]
Eclipse for PHP Developers Formatter settings panel
Comment 4 Abrahala Gabra CLA 2012-07-02 06:15:43 EDT
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.
Comment 5 Dawid Pakula CLA 2014-07-05 14:37:22 EDT
Everything works correctly with current nightly build.
Comment 6 Sylvia Tancheva CLA 2015-05-28 10:39:17 EDT
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