I've moved from PDT to Netbeans recently, and there is something I can't figure out. How do I get the IDE to use 'use' statements at the beginning of a file on autocompleting class names? Like:
use \Foo\Bar\Baz; class Something extends Baz { /* ... */ }
Instead, if I use autocompletion I get
class Something extends \Foo\Bar\Baz { /* ... */ }
I've checked the code completion settings, but the most promising option (smart) wanted me to first write the imports in order to use autocompletion for short class names. PDT was capable writing that line to the beginning of the file.
In newer versions of Netbeans (i.e. 7.3+), you can press Ctrl+Shift+I
(Alt+Shift+I
won't work as expected, though).
First, it searches for any smart or fully qualified instances in your file and then asks you of what types the found ones should be. It then adds fully qualified use statements to the top of your file and changes existing instances in the source to unqualified.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With