문제

I am using Netbeans 8.0 for PHP

I try to use code completion feature, when I type

new EntityM

Netbeans shows: enter image description here

great so far, I hit enter on the first option, then Netbeans generates:

enter image description here

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top