IMHO not possible now, there is some enhancement in NetBeans' bugzilla. The "workaround" is to let NetBeans insert FQN and then press Ctrl+Shift+I to fix namespaces, this will remove FQN and insert use statements.
Netbeans code completion full class+namespace VS "use"
-
14-07-2023 - |
Question
I am using Netbeans 8.0 for PHP
I try to use code completion feature, when I type
new EntityM
Netbeans shows:
great so far, I hit enter on the first option, then Netbeans generates:
What I want to do: Instead of generating a full class name (namespace+class name) I want Netbeans to add a use statement and a simple class name, this will add:
use \Doctrine\ORM\EntityManager;
before my class declaration and the generated code will be:
$d = new EntityManager($conn, $config, $eventManager)
Anyone could advise how to achieve this?
PS: This is exactly how PHPStorm works.
La solution
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow