我使用带有 clang-format 扩展名的 Visual Studio Code 来格式化 .c 源代码文件 - 它有效。
现在我有特殊文件(也有 C 风格),但该文件无法识别格式,因为它们具有另一个文件扩展名 (.kki)。
如何在 Visual Studio Code 中配置 clang-format 扩展以将我的 .kki
文件识别为 C 源代码文件?
最佳答案
检查您是否可以遵循“Adding a file extension to a language ”部分:
You can add new file extensions to an existing language with the
files.associations
setting.For example, the setting below adds the .myphp file extension to the php language identifier:
"files.associations": { "*.myphp": "php" }
IntelliSense (Ctrl+Space) will show you the available language identifiers.
就您而言:
"files.associations": {
"*.kki": "c"
}
关于visual-studio-code - VSCode 和 clang 格式 : use my own file extension,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50977305/