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.
Fix uses occasionally puts namespace statement after use statements (wrong and undesirable) but unfortunately i cant reproduce it now.. When i run into it again i will try to update this issue.. //E.g. <? use NS1\NS2\SomeClass; use NS2\NS2\SomeClass2; namespace NS1; //uses should be here ?>
I can't reproduce it either.
Hello, it occurred again on dev version Build 201308270001 with the option "remove unused uses" set on. It seems to me that the problem occurs when the option is set on because when it was set off i havent met the problem. Anyway i am not able to reproduce it because when i reverted the code to the state before and used it again this time i didnt happen.
Sorry, but I'm not able to reproduce that... P4 util we have a reproducible test case. Without that I'm not able to do anything.
I understand.. Just wanted to point out that the bug exists in the latest versions too.
step 1: http://i.imgur.com/vMUukEt.png step 2: http://i.imgur.com/9549umd.png step 3: http://i.imgur.com/sFa7NQ7.png step 4: http://i.imgur.com/nlzGUqq.png Product Version = NetBeans IDE Dev (Build 201310110001) Operating System = Windows 8 version 6.2 running on x86 Java; VM; Vendor = 1.7.0_25 Runtime = Java HotSpot(TM) Client VM 23.25-b01
Yep, I know where is the problem. The problem is in a place, where is the caret, when Fix Uses is invoked. In this case, it's outside of any class...at the and of a file. In the whitespace. And because PHP parser doesn't handle whitespaces (lexer ignores it), then the "place of invocation" is considered to be a default ns...(literally...it's invoked "nowhere"...from parser point of view the invoking place doesn't exist.) And unfortunately it can't be simply fixed. There is a workaround for that, never invoke that action at the end of a file. Put the caret somewhere inside it. Reproducible case: file1.php ---- <?php namespace Aaa; class Foo {} ?> ---- file2.php ---- <?php namespace Bbb; class Bar extends Foo {} ^ ?> ...and invoke Fix Uses on a ^ caret place.