Is there a way to define a custom tag with an attribute containing a file path (i.e. "src" attribute) and to make webstorm autocompletion work within this attribute?
you can inject File Reference language in attribute value: put cursor between quotes in attribute value, hit Alt+Enter, choose to inject language or references, choose File reference from the list
you can inject File Reference language in attribute value: put cursor between quotes in attribute value, hit Alt+Enter, choose to inject language or references, choose File reference from the list
the corresponding language injection;
is there any tag like /* @lang File Reference */ to use instead choose from alt+enter ? especially in PhpStorm (PHP language)
Yes
<custom src=""></custom>
should do the thing
Could you please paste working example for PHP ?
This not works for me (in latest PhpStorm IDE):
works only with alt + enter
maybe it is possible to inject file reference via "PHP attributes" ?
It works as expected for me in HTML and javascript:
But injecting languages in PHP might be tricky. Can't advise on this, sorry, not an expert here. I'd suggest asking a question at https://intellij-support.jetbrains.com/hc/en-us/community/topics/200367219-PhpStorm
Looks like Alt+Enter is the only solution for PHP now
Here are some related feature requests:
#[Language]PHP attribute: https://youtrack.jetbrains.com/issue/WI-56996Watch those tickets (star/vote/comment) to get notified on any progress