如何在 VSCode 中设置 XML 的默认格式化程序?

时间:2021-06-11 10:11:03

标签: visual-studio-code vscode-settings

我尝试在 VSCode 中格式化 XML,但是每次我点击 Shift+Alt+F 时,我都会收到一个弹出窗口,提示“未安装 'xml' 文件的格式化程序”并提供 [取消] 或 [安装格式化程序..]。

最后统计,我安装了 6 个,但它仍然做同样的事情。

查看 Settings.json,我看到:

"[xml]": {
    "editor.defaultFormatter": "redhat.vscode-xml"
},

如果我将鼠标悬停在“redhat.vscode-xml”上,我会收到一条提示:

Value is not accepted. Valid values: null, "vscode.css-language-features", "vscode.html-language-features", "vscode.json-language-features", "ms-toolsai.jupyter", "vscode.markdown-language-features", "vscode.php-language-features", "ms-vscode.references-view", "ms-vscode-remote.remote-ssh-edit", "vscode.search-result", "vscode.typescript-language-features", "vscode.configuration-editing", "vscode.debug-auto-launch", "vscode.debug-server-ready", "vscode.emmet", "vscode.extension-editing", "vscode.git", "vscode.github", "vscode.github-authentication", "vscode.grunt", "vscode.gulp", "ms-vscode.hexeditor", "vscode.image-preview", "vscode.jake", "ms-vscode.js-debug", "ms-vscode.js-debug-companion", "vscode.merge-conflict", "vscode.microsoft-authentication", "ms-vscode.node-debug", "ms-vscode.node-debug2", "vscode.npm", "ms-vscode-remote.remote-containers", "ms-vscode-remote.remote-ssh", "ms-vscode-remote.remote-wsl", "ms-vscode-remote.remote-wsl-recommender", "vscode.simple-browser", "vscode.testing-editor-contributions", "ms-vscode.vscode-js-profile-table", "GitHub.vscode-pull-request-github".(1)

据推测,有一些方法可以添加列表,但在安装格式化程序时不会自动完成。

仅供参考,如果有区别的话,我使用的是 VSCode Insiders 版本。

0 个答案:

没有答案