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.
Product Version: NetBeans IDE Dev (Build 2009-04-09_09-05-02 ) Java: 1.6.0_13; Java HotSpot(TM) 64-Bit Server VM 11.3-b02 **Example initial: <? // If done processing a 'param', append it to the 'params' array. -> manually added if (!strcmp($name, 'param')) { $this->record['params'][] = array_pop($this->stack); } // If done with the 'record' parsing, dump it. -> manually added elseif (!strcmp($name, 'record')) { // TODO: replace with DB INSERT --> manually added // print_r($this->record); --> ctrl+/ $this->normalizeRecord(); //comment(); --> manually added $this->storeRecord(); array_pop($this->stack); } ?> result: <? // If done processing a 'param', append it to the 'params' array. -> manually added if (!strcmp($name, 'param')) { $this->record['params'][] = array_pop($this->stack); } // If done with the 'record' parsing, dump it. -> manually added elseif (!strcmp($name, 'record')) { -> WRONG! Already reported // TODO: replace with DB INSERT --> WRONG // print_r($this->record); --> WRONG $this->normalizeRecord(); //comment(); --> OK $this->storeRecord(); array_pop($this->stack); } ?> expected result: // If done processing a 'param', append it to the 'params' array. -> manually added if (!strcmp($name, 'param')) { $this->record['params'][] = array_pop($this->stack); } // If done with the 'record' parsing, dump it. -> manually added elseif (!strcmp($name, 'record')) { // TODO: replace with DB INSERT --> manually added // print_r($this->record); --> ctrl+/ $this->normalizeRecord(); //comment(); --> manually added $this->storeRecord(); array_pop($this->stack); }
included into unit tests php.editor/test/unit/data/testfiles/formatting/real_life/comments_in_statements.php
confirmed, a minimal test case: <?php if (1) { //comment echo 1; } ?>
one more example: function encounterPageName() { // comment <- this one is correct behaviour after pressing ctrl+// calSomeDummyFunction } result after pressing alt+shift+f to format source function encounterPageName() { // comment <- INCORRECT calSomeDummyFunction } expected result: function encounterPageName() { // comment <- CORRECT calSomeDummyFunction }
*** Issue 166399 has been marked as a duplicate of this issue. ***
keep it p2 - this issue is here too long and nothing is going on. it's not going to disappear between other formatting issues, at least.
Another example: (the first line in the method - comment - is not indented) ----- %< ----- class Jobeet { static public function slugify($text) { // replace all non letters or digits by - $text = preg_replace('/\W+/', '-', $text); // trim and lowercase $text = strtolower(trim($text, '-')); return $text; } } ----- %< -----
one more. After I used hint to implement all abstract methods I realized indentation is wrong so i used formatting and comment was incorrectly formatted. initial state: class PageLogin extends Page { //put your code here public function setPageTitle() { } public function setPageVariables() { } public function setPageContentDescription() { } public function getPageContentVars() { } } after format: class PageLogin extends Page { //put your code here <-- wrong public function setPageKeywords() { } public function setPageTitle() { } public function setPageVariables() { } public function setPageContentDescription() { } public function getPageContentVars() { } }
*** Issue 158921 has been marked as a duplicate of this issue. ***
Will you be able to fix&verify the issue till Fr 3-July when is cut-off-day for Patch1. thanks petr
No. The fix will depend on other post-67 changes, so it is not a good candidate for a patch
http://hg.netbeans.org/web-main/rev/cfd834b95566 - partial fix
*** Issue 167907 has been marked as a duplicate of this issue. ***
The remaining part of problems described in this report is covered by issue 162586. I am closing this issue and upgrading 162586 to P2 for more clarity
Integrated into 'main-golden', will be available in build *200908101401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/cfd834b95566 User: Tomasz Slota <tslota@netbeans.org> Log: #162320: wrong formatting of comments (part 1)
*** Issue 171254 has been marked as a duplicate of this issue. ***
*** Issue 172123 has been marked as a duplicate of this issue. ***
*** Issue 172116 has been marked as a duplicate of this issue. ***
*** Issue 173333 has been marked as a duplicate of this issue. ***
unit test added
Integrated into 'main-golden', will be available in build *200910091401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/5108cdf6c4d7 User: Filip Zamboj <fzamboj@netbeans.org> Log: unit tests for #160996 and #162320 fixed