对文件路径强制执行自动完成建议 [英] Force autocomplete suggestions for file paths

查看:99
本文介绍了对文件路径强制执行自动完成建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在为Phalcon项目制作控制器文件.我喜欢PhpStorm如何在HTML文件中编写src或href值时为您提供自动完成建议.我想知道,是否可以在控制器中添加资源时启用自动完成建议?

这是我强制执行自动完成建议时发生的情况(Ctrl +空格)
这就是我想发生的事情.

I am currently working on a controller file for a Phalcon project. I like how PhpStorm gives you autocomplete suggestions when writing a src or href value in an HTML file. I was wondering, is possible to enable autocomplete suggestions when adding resources in a controller?

This is what happens when I force autocomplete suggestions(Ctrl + Space)
This is what I would like to happen.

编辑:我还应注意,我已将包含所有资源(即CSS,javascript和图像)的文件夹标记为资源根目录".

I should also note that I have marked the folder, containing all my resources(ie. CSS, javascript, and images), as the "Resource root".

RE:编辑
这不会以任何方式影响此功能/功能的可用性,因为资源根"用于路径解析/验证,而不是实际的提供此功能或隐藏它"的选择.
-LazyOne

推荐答案

不幸的是,没有真正的方法可以自动在随机字符串中提供此类功能,因为很难猜测在此特定位置需要文件路径(功能参数不同)情况-此处可以使用一些提示机制(特殊注释).

Unfortunately there is no real way of automatically providing such functionality in random string as it's hard to guess that file path is expected in this particular place (function parameters is different case -- here some hinting mechanics (special annotation) may work).

但是..您可以手动为每个特定位置强制启用它(应持续到关闭文件或项目为止):

But .. you can forcibly enable it manually for each particular place (should last until file or project is closed):

  1. 有一些代码,例如$someVar = ['css' => 'aaa'];
  2. 将插入号放置在aaa字符串内(根据我的观察,它必须为3个或更多字符,否则#4中的选项将不存在-必须是从IDE方面进行某种优化/限制)
  3. 调用快捷方式以打开快速修复"菜单(在Windows中为 Alt + Enter )
  4. 从出现的菜单中选择Inject language or reference
  5. 从下一个菜单中选择File Reference
  6. 开始使用它( Ctrl +空格)
  1. Have some code, e.g. $someVar = ['css' => 'aaa'];
  2. Place caret inside aaa string (it has to be 3 or more characters, based on my observations, otherwise option in #4 will not be present -- must be some sort of optimisation/limitation from IDE side)
  3. Invoke shortcut to bring "Quick Fix" menu (Alt + Enter on Windows)
  4. Choose Inject language or reference from appeared menu
  5. Choose File Reference from next menu
  6. Start using it (Ctrl + Space)


我还应该注意,我已将包含所有资源(即CSS,javascript和图像)的文件夹标记为资源根目录".

I should also note that I have marked the folder, containing all my resources(ie. CSS, javascript, and images), as the "Resource root".

这不会以任何方式影响此功能/功能的可用性,因为资源根"用于路径解析/验证,而不是用于实际的提供此功能或隐藏它"选择.

This does not affect availability of this feature/functionality in any way as "Resource roots" are used for path resolutions/validation and not for actual "offer this functionality or hide it" choice.

这篇关于对文件路径强制执行自动完成建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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