Visual Studio Code中没有HTML建议 [英] No HTML suggestions in Visual Studio Code

查看:130
本文介绍了Visual Studio Code中没有HTML建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经下载了

我已阅读

此外,我在 settings.json 文件中启用了HTML5建议:

  {"workbench.colorTheme":"Visual Studio Light","workbench.activityBar.visible":是,"editor.multiCursorModifier":"ctrlCmd","window.zoomLevel":0,"html.suggest.html5":是的,} 

但是,HTML,CSS建议不起作用.

我该怎么做才能给出建议?

解决方案

我认为问题是Visual Studio Code无法正确检测文件类型.如果您在这些图片中注意到,vscode已正确检测到我正在通过屏幕右下角的文件名和语言指示符旁边的<> 图标编写html文件.

在您的情况下,语言指示器很可能会说纯文本.单击它,菜单应该出现在屏幕的顶部中心.然后尝试以下操作:

  1. 启用自动检测.我认为这将是第一个选择.
  2. 选择为".html"配置文件关联...
  3. 2也可以通过添加

    来完成

    "files.associations":{"* .html":"html"}

    更改设置.

或仅将其添加到 settings.json(文件->首选项->设置):

  {//配置文件与语言的关联(例如"* .extension":"html").这些有//优先于已安装语言的默认关联."files.associations":{"* .html":"html"},} 

I've download the latest Visual Studio Code and am trying to write some HTML code. For example, <div>, <a>, <p> tags. However, there are no HTML suggestions in Visual Studio Code:

I've read this article and it says:

Visual Studio Code provides basic support for HTML programming out of the box.

However, I've tried to install HTML extension:

In addition, I've turned on HTML5 suggestion in settings.json file:

{
    "workbench.colorTheme": "Visual Studio Light",
    "workbench.activityBar.visible": true,
    "editor.multiCursorModifier": "ctrlCmd",
    "window.zoomLevel": 0,
    "html.suggest.html5": true,    
}

Nevertheless, HTML, CSS suggestion does not work.

What can I do to code with suggestions?

解决方案

I think the issue is that Visual Studio Code is not detecting the file type correctly. If you notice in these pictures, vscode has correctly detected that I am writing a html file by the icon <> beside the file name and the language indicator in the bottom right of the screen.

The language indicator most likely says plain text in your case. Click on it and a menu should appear at the top centre of the screen. Then try the following:

  1. Enabling Auto Detect. I think this will be the first option.
  2. Selecting Configure File Association for '.html'...
  3. 2 can also be accomplished by adding

    "files.associations": { "*.html": "html" }

    to your settings.

OR just add to settings.json (File -> Preferences -> Settings):

{
     // Configure file associations to languages (e.g. "*.extension": "html"). These have 
     //precedence over the default associations of the languages installed.
     "files.associations":  { "*.html": "html" },
}

这篇关于Visual Studio Code中没有HTML建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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