visual-studio-code - 使用链接的css文件在html文件中没有ctrl +空格的VS Code自动完成
问题描述
我对全新安装 vs 代码有疑问。我是第一次使用它,对我来说,一件很烦人的事情是,当我在我的 html 文件中写入时:
<div id
然后按 Enter 它需要我
<div id=""
但我必须 ctrl+space 才能看到 CSS 的自动完成
id 喜欢键入和自动完成自动启动。
尝试这样的用户设置和工作区设置:
{
"editor.quickSuggestions": {
"other": true,
"comments": true,
"strings": true
},
"editor.wordBasedSuggestions": true
}
对我不起作用。
请帮忙
这是我的新工作区配置
{
"editor.quickSuggestions": {
"other": true,
"comments": true,
"strings": true
},
"editor.wordBasedSuggestions": true,
"emmet.triggerExpansionOnTab": true,
"editor.wordBasedSuggestions": true,
// true is the default already
"emmet.showAbbreviationSuggestions": true,
"editor.snippetSuggestions": "top",
"emmet.showSuggestionsAsSnippets": true
}
这让我输入 div.classname 并显示我的 css 类列表,但 div#idname 不起作用:) 不知道该怎么做
解决方案
在这里使用 emmet 扩展,它会容易得多。
div#myId
然后enter或tab或将扩展为:
<div id="myId"></div>
要使用tab完成,true
请在您的设置中将其更改为:
"emmet.triggerExpansionOnTab": true,
您应该无需执行Ctrl-即可看到 emmet 建议space。试试这些设置:
// true is the default already
"emmet.showAbbreviationSuggestions": true,
"editor.snippetSuggestions": "top",
"emmet.showSuggestionsAsSnippets": true,
此外,这些设置对您的问题没有影响:
[在字符串或评论中输入时会显示建议]:
{
"editor.quickSuggestions": {
"other": true,
"comments": true,
"strings": true
},
[建议也将包括文档中的所有文本 - 通常会使您的建议列表变得混乱,但无论如何您都想要它]:
"editor.wordBasedSuggestions": true
推荐阅读
- nlp - CompletedSubTask' 对象没有属性 'aspect_representation
- c# - 给定 N,对于从 1 到 N 的连续数字,创建一个递归 C# 方法来打印出所有可能的“+”和“-”组合,从而导致 X
- javascript - 是否有比 string.split() 更好的解决方案来从 ES6 中的文本块中选择前两行
- sqlite - 如何在 Sqlflite Flutter 中使用嵌套模型
- eclipse - 在 Eclipse 中,Oracle Weblogic Server 没有出现在 New Server 窗口中
- python - Scipy稀疏矩阵乘法是否并行?
- windows-10 - Windows 10 更新后设置没有打开?
- job-scheduling - 如何在 Rundeck 中创建一个触发 REST URL 的作业?
- google-cloud-storage - 涓流不限制 gsutil 的带宽
- android - Wear OS 模拟器没有正确响应