VSCode html 文件格式化程序不起作用

And*_*rej 5 visual-studio-code

我的智能感知有问题我已经禁用了所有扩展,但我仍然得到:

抱歉,没有安装 html 文件的格式化程序

任何的想法?

VS 代码版本 1.19.1

// Enable/disable autoclosing of HTML tags.
"html.autoClosingTags": true,

// List of tags, comma separated, where the content shouldn't be reformatted. 'null' defaults to the 'pre' tag.
"html.format.contentUnformatted": "pre,code,textarea",

// Enable/disable default HTML formatter
"html.format.enable": true,

// End with a newline.
"html.format.endWithNewline": false,

// List of tags, comma separated, that should have an extra newline before them. 'null' defaults to "head, body, /html".
"html.format.extraLiners": "head, body, /html",

// Format and indent {{#foo}} and {{/foo}}.
"html.format.indentHandlebars": false,

// Indent <head> and <body> sections.
"html.format.indentInnerHtml": false,

// Maximum number of line breaks to be preserved in one chunk. Use 'null' for unlimited.
"html.format.maxPreserveNewLines": null,

// Whether existing line breaks before elements should be preserved. Only works before elements, not inside tags or for text.
"html.format.preserveNewLines": true,

// List of tags, comma separated, that shouldn't be reformatted. 'null' defaults to all tags listed at https://www.w3.org/TR/html5/dom.html#phrasing-content.
"html.format.unformatted": "wbr",

// Wrap attributes.
"html.format.wrapAttributes": "auto",

// Maximum amount of characters per line (0 = disable).
"html.format.wrapLineLength": 120,

// Configures if the built-in HTML language support suggests Angular V1 tags and properties.
"html.suggest.angular1": true,

// Configures if the built-in HTML language support suggests HTML5 tags, properties and values.
"html.suggest.html5": true,

// Configures if the built-in HTML language support suggests Ionic tags, properties and values.
"html.suggest.ionic": true,

// Traces the communication between VS Code and the HTML language server.
"html.trace.server": "off",

// Configures if the built-in HTML language support validates embedded scripts.
"html.validate.scripts": true,

// Configures if the built-in HTML language support validates embedded styles.
"html.validate.styles": true,
Run Code Online (Sandbox Code Playgroud)

谢谢

Mit*_*tch 1

当我遇到这个问题时,我正在使用一个 html 文件,该文件不在打开的文件夹中,也不在 VSC 工作区中。当我设置包含该文件的工作区时,html 格式化程序可以工作。