Community
Participate
Working Groups
Code is not properly indented, see http://www.racehub.se/div/php-bugs.html for examples. PHP formatting is set up to use four spaces, and the same goes for HTML source code.
can't reproduce.
what version of Eclipse, WTP, PDT are/were you using, and what JDK, OS, WS?
What it says in the report. ;) (Windows, PDT v1.0.2) My Java is v1.5.11 by the way. I'll give it a shot with PDT 1.0.3 and see if it still exists there. Will report back during the weekend. If it fails, I'll attach a source file you can test it with.
Created attachment 103017 [details] Source file to test with
Just tried with a clean install of PDT v1.0.3 and a new workspace, and it's still wrong. I have attached a file for you to test with: 1) Position the caret at the end of line 3 and hit return. This puts the cursor in column 5, not 13, as expected. 2) Select line 3, hit Ctrl/C, then put the cursor on line 4, column 1 and press Ctrl/V a couple of times. The pasted line shifts to the right all the time. This was reported in an early version of PDT and was fixed back then, but it must have broke again. (Bug 149399)
I think my problems caused by this bug too. Code to type: <?php $arr = array( 'str1', 'str2', ); call_the_func( 'str1', 'str2' ); ?> When I press <enter> after "'str1'," caret moves to the begining of the next line without indention.
After another 6 months (:rolleyes:) I just noticed something that may or may not be related to this, but if you use Denis' example and replace the parentheses with curly braces (which is obviously syntactically incorrect, but anyway) the indentation actually works as it should... Is the editor using some other language than PHP for its indentation?
Final addition: If the page http://files.zend.com/help/PDT-Help/Formatting_Code.htm is correct, the code formatting is completely broken, because if I create a PHP file with the code in the example, all the formatting does is to indent some of the lines, and other lines even more, seemingly with no language knowledge at all. Code to paste into a file when testing: <?php class Calculator { public function add($a, $b) { return $a + $b; } public function multiply($a, $b) { return $a * $b; } public function divide($a, $b) {if ($b == null) { throw new Exception(""); } return $a / $b;} public function subtract ($a,$b) { return $a - $b;}} ?>
Still relevant - changing version to 2.0.0 [Sylvia Tancheva]
Reproducible on 2.1-SR1 Moving to 2.2.0
fixed in head
[Petyo Tanchev] Tested on 2.2.0 from 13 Aug. 2010 Still relevant
Tested on 2.2.1.v20100829 Still reproducible
I could not reproduce this bug,and if you can,please reopen it,and there are several issues in this bug,it is better to tell which one is reproducible.Thanks
This surely isn't fixed in any of the available versions of PDT I can find on eclipse.org. (I have PDT 2.2.1 here, and it happens in that version) The PDT project seems a bit dead though, so I'm not sure what I should do to verify if it's properly fixed or not?
Forgot to say that all reported issues are still there in PDT 2.2.1.
You can verify it with Indigo developer build. Download Platform Runtime Binary and install it. http://download.eclipse.org/eclipse/downloads/drops/S-3.7M7-201104280848/index.php#PlatformRuntime Download last successful build of PDT and install it on 3.7M7(Help>Install New Software>Add>Archive>choose downloaded zip). https://hudson.eclipse.org/hudson/job/cbi-pdt-3.0-indigo/lastSuccessfulBuild/artifact/build/N201105100313/pdt-Update-N201105100313.zip
I tested the bugs on page http://www.racehub.se/div/php-bugs.html,still exist(not exactly same) and I think the bug is related to the formatter.
fixed
Tested in pdt 3.0 - Verified.