问题描述
我使用的是JetBrains PhpStorm,这可能是我用过的最史诗的IDE。
I'm using JetBrains PhpStorm, which is probably the most epic IDE I've ever used.
问题很简单。我如何添加Compass语法支持呢?我已经安装了它,它渲染和工作,但PhpStorm仍然抱怨未定义的导入和mixins。
The question is simple. How do I add Compass syntax support to it? I've got it installed, it renders and works, but PhpStorm still complains about undefined imports and mixins.
我如何解决这个问题?可以将Compass作为外部库吗?
How can I resolve this? Can Compass be included as an external library?
编辑:我只想请注意, 适用于RubyMine IDE(也由JetBrains提供),它的不是为PhpStorm / WebStorm。
Edit: I'd just like to note that this feature request is for the RubyMine IDE (also by JetBrains), it's not for PhpStorm/WebStorm.
推荐答案
这是马丁的答案的解释。
It's explanation of Martin's answer.Symlink to compass gem directory in your sass folder works great.
指令(Windows)
Instruction(Windows)
- 使用管理员权限打开cmd
- 更改项目sass文件夹的路径,例如
cd projectname\sass
- 运行
mklink / d compass $ GEM_LOCATION\frameworks\compass\stylesheets\compass
,对我来说$ GEM_LOCATION =C:\dev\Ruby200\lib\ruby\gems\2.0.0\gems\compass-0.12.2
- open cmd with admin privileges
- change path to your project sass folder, for example
cd projectname\sass
- run
mklink /d compass $GEM_LOCATION\frameworks\compass\stylesheets\compass
, as for me $GEM_LOCATION =C:\dev\Ruby200\lib\ruby\gems\2.0.0\gems\compass-0.12.2
这就是所有,现在PhpStorm不会突出罗盘mixins作为错误,并将它们添加到自动完成建议。
Thats all, now PhpStorm will not highlight compass mixins as errors, and will add them in autocomplete suggestions.
警告:如果要删除已创建的符号链接,请勿使用delete,它将删除源目录。
打开具有管理员权限的cmd, cd $ yourProjectSassPath
,并运行 rmdir compass
Warning: If you want to delete created symlink DON'T use delete, it will remove source directory.open cmd with admin privileges, cd $yourProjectSassPath
, and run rmdir compass
这篇关于如何添加指南针语法支持到Jetbrains PhpStorm?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!