PhpStorm到资源根的相对路径 [英] PhpStorm relative path to resource root

查看:445
本文介绍了PhpStorm到资源根的相对路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用PhpStorm 9,并且我的项目结构与此类似:

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

我使用聚合物,因此在使用元素时必须导入这些元素.我还使用AngularJS,它将加载后的应用程序定向到 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">

我已将 src/目录设置为 RESOURCES ROOT ,因此它不会在href路径下显示背景色,但是如果我使用自动提示( CTRL + 2x SPACE ),它返回相对于文件application.html 的路径不相对于index.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.

如何实现?

推荐答案

当前,唯一的方法是依次依次键入/自动完成每个文件夹:首先elements,然后element-alfa,然后自动完成文档名称.我为此创建了功能请求: https://youtrack.jetbrains.com/issue/WEB- 30888

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

这篇关于PhpStorm到资源根的相对路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆