VSCode:通过路径智能感知显示用户片段
我正在尝试将路径智能感知优先于我的用户片段,或者只是将它们与其他非用户片段真正分组。当前的行为是user snippets ->路径 ->其他片段
如屏幕截图所示:
我需要导航路径,我不知道结构,但每个级别我都必须向下滚动到建议,这非常烦人。我已经禁用了一些代码片段,但它仍然很烦人,并且不值得仅仅因为这个而关闭自定义代码片段。
我尝试过的一些设置是 "editor.snippetSuggestions": "inline"
和 "editor.quickSuggestions": { "strings": false" }
。还尝试了最流行的路径自动完成 ?
我是唯一对此感到恼火的人吗?这是默认行为还是我弄乱了我的配置
I'm trying to prioritize path intellisense over my user snippets, or just group them with other non-user snippets really. The current behaviour is user snippets -> paths -> other snippets
as seen in the screenshot:
I need to navigate paths I don't know the structure but each level I have to scroll down to the suggestion and it's very annoying. I have disabled some snippets, but it's still annoying and it's not worth to turn off custom snippets just because of this.
Some settings I tried are "editor.snippetSuggestions": "inline"
and "editor.quickSuggestions": { "strings": false" }
. Also tried most popular path autcomplete extensions.
Am I the only one annoyed by this? Is this the default behaviour or did I messed up my config? Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于 HTML,
我设法找到了解决此问题的三种解决方法:
查看实际效果:
对于 JavaScript/TypeScript
对于 JavaScript 或 TypeScript 等其他语言,我使用 path-intellisense 扩展(扩展 ID:
christian-kohler.path-intellisense
),在用户 JSON 配置中使用以下设置:通过调整这些设置,我确保使用扩展而不是 Visual Studio Code for JavaScript 中的默认路径自动完成功能和打字稿。
autoSlashAfterDirectory
设置可防止在目录后自动添加斜杠,而autoTriggerNextSuggestion
可确保建议小部件在从键盘手动输入斜杠之前不会自动显示。此配置产生所需的结果,如下所示:
For HTML
I have managed to find three workarounds for this issue:
see it in action :
For JavaScript/TypeScript
For other languages like JavaScript or TypeScript, I use the path-intellisense extension (extension ID:
christian-kohler.path-intellisense
) with the following settings in the user JSON configuration:By adjusting these settings, I ensure that the extension is used instead of the default path autocomplete feature in Visual Studio Code for JavaScript and TypeScript.
The
autoSlashAfterDirectory
setting prevents automatic addition of a slash after a directory, andautoTriggerNextSuggestion
ensures that the suggestion widget doesn't appear automatically until a slash is entered manually from the keyboard.This configuration produces the desired result, as demonstrated here :