PhpStorm relative path to resource root

陌路散爱 提交于 2020-01-03 17:20:36

问题


I use PhpStorm 9 and I have project structure similar to this:

src/
   elements/
      element-alfa/
         element-alfa.html
         element-alfa.scss
   templates/
      application.html
   index.html

I use Polymer so I have to import the elements when I use them. I also use AngularJS, which direct the app after load to application.html, but in fact paths are like from the index.html file.

<link rel="import" href="elements/element-alfa/element-alfa.html">

I have set the src/ directory as RESOURCES ROOT so it does not tinged the background color under href path but if I use auto hint (CTRL + 2x SPACE), it returns the path relative to the file application.html, not relative to the index.html (or my resources root) as I wanted to.

How to achieve it?


回答1:


Currently, the only way to do it is to type/autocomplete each folder one by one sequentially: first elements, then element-alfa, and then autocomplete filename. I created a feature request about this: https://youtrack.jetbrains.com/issue/WEB-30888



来源:https://stackoverflow.com/questions/31317048/phpstorm-relative-path-to-resource-root

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!