如何使用扩展名为 yaml 的文件在 vscode 中预览 asciidoc

How to preview asciidoc in vscode with a file with a yaml extension

我有一个文件,其顶部包含 YAML,底部包含 asciidoc。 yaml 被两行 --- 包围。文件扩展名为 yaml,这是使用它的应用程序所必需的。

我知道从 vscode 中获得预览的唯一方法是每次我需要时手动重命名文件,然后再重命名。

有没有办法在 vscode 中打开 asciidoc 预览,同时忽略其扩展名,例如给出提示,添加配置或类似的东西? The docs 只描述

The extension activates automatically when opening an AsciiDoc file (.adoc, .ad, .asc, .asciidoc).

这是一个示例文件:

---
# yaml here
---
asciidoc here

这非常简单: https://code.visualstudio.com/docs/languages/overview#_changing-the-language-for-the-selected-file

In VS Code, we default the language support for a file based on its filename extension. However, at times you may want to change language modes, to do this click on the language indicator - which is located on the right hand of the Status Bar. This will bring up the Select Language Mode dropdown where you can select another language for the current file.

Tip: You can get the same dropdown by running the Change Language Mode command (Ctrl+K M).