idea-php-annotation-plugin icon indicating copy to clipboard operation
idea-php-annotation-plugin copied to clipboard

Plugin should support completing class alias

Open cedricziel opened this issue 8 years ago • 0 comments

When a UseImportOption maps a concrete class to an alias, the plugin should autocomplete on it.

Example:

ClassName is TYPO3\CMS\Extbase\Annotation\Inject, alias is inject. What we need, is completion for lowercase @inject. I know this seems a bit clunky since we can alias an annotation to almost anything, but TYPO3 CMS recently introduced doctrine annotations and to minimize the impact, the current best-practice is to alias the new Inject Annotation to the old @inject phpDoc tag.

Currently, the completion provider completes the Annotation since there's nothing special, but when selected, it imports the annotation as specified (use TYPO3\CMS\Extbase\Annotation\Inject as inject) then inserts @Inject (which is not the correct value in this case) and then, to make it even worse, imports the Inject class once again. Sigh.

cedricziel avatar Nov 28 '17 11:11 cedricziel