Path autocompletion for attribute in custom tags

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?

0
7 comments

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;

2

is there any tag like /* @lang File Reference */ to use instead choose from alt+enter ? especially in PhpStorm (PHP language)

0

Yes

<!-- language=file-reference -->
<custom src=""></custom>

should do the thing

0

Could you please paste working example for PHP ?

This not works for me (in latest PhpStorm IDE):

// language=file-reference
$file1 = './'; // no completion

$file2 = /* @lang file-reference */ './'; // no completion

works only with alt + enter

0

maybe it is possible to inject file reference via "PHP attributes" ?

0

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

0

Looks like Alt+Enter is the only solution for PHP now

Here are some related feature requests:

Watch those tickets (star/vote/comment) to get notified on any progress

0

Please sign in to leave a comment.