This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | 'Wrong' indention depth when assigning a methods return value | ||
---|---|---|---|
Product: | php | Reporter: | edorian |
Component: | Navigation | Assignee: | Petr Pisl <ppisl> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P3 | ||
Version: | 7.0 | ||
Hardware: | PC | ||
OS: | Windows 7 x64 | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
edorian
2011-03-07 17:26:03 UTC
Batch reassigning. Editor area. The reason, why there are 8 spaces is that it's continual expression. The function call continues on next line and there is used the continual size indentation, which is by default 8. You can change the value in the options. I'm closing this as want fix, but feel free if to reopen if you think that there should be created a special rule for this case. First off: Thanks for replying :) I didn't make my case clear enough it seems. "Continual indentation" is set to 4 in this example. The indentation IMHO should be the same if you say $this->foobar( 4spaces and if you say $x = $this->foobar( shouldBeAlso4spaces---ButItIs8 Maybe this reproduce snipped can explain it better: Before: --------------- <?php class foo { public function test() { // just the function call $this->foobar( 1, 2 ); // fuction call AND assignment, this changes on reformat! $x = $this->foobar( 1, 2 ); } } After: -------------- <?php class foo { public function test() { // just the function call $this->foobar( 1, 2 ); // fuction call AND assignment, this changes on reformat! $x = $this->foobar( 1, 2 ); } } ---------------------------------- So if you think this is correct behavior ("Indenting twice, once for the assignment once for the function") then: yeah. I'd LOVE to be able to turn this off since i don't want do have the other code lines change when i decide to take a functions return value into a variable Thanks again, edorian Thanks, now I understand:) . You are right, it's indented with 8 spaces because there are two indent level. One for assignment and one for the function invocation that is over more lines. And you are right, it's strange in this case. I'm going to fix it. Fixed in web-main and releases/release701. Integrated into 'releases' Changeset: http://hg.netbeans.org/releases/rev/dcf0c81291c9 User: Petr Pisl <ppisl@netbeans.org> Log: #196405 - 'Wrong' indention depth when assigning a methods return value (transplanted from 22fc6c5ff7e2db144dabc28be4fa7af5446a8585) Integrated into 'main-golden' Changeset: http://hg.netbeans.org/main-golden/rev/22fc6c5ff7e2 User: Petr Pisl <ppisl@netbeans.org> Log: #196405 - 'Wrong' indention depth when assigning a methods return value |