【问题标题】:VSCode and clang-format: use my own file extensionVSCode 和 clang-format:使用我自己的文件扩展名
【发布时间】:2018-12-01 07:17:43
【问题描述】:

我使用带有 clang-format 扩展名的 Visual Studio Code 来格式化 .c 源代码文件——它可以工作。

现在我有特殊文件(也有 C 风格),但这些文件的格式无法识别,因为它们有另一个文件扩展名 (.kki)。

如何在 Visual Studio Code 中配置 clang 格式扩展以将我的 .kki 文件识别为 C 源代码文件?

【问题讨论】:

    标签: visual-studio-code clang-format


    【解决方案1】:

    检查您是否可以关注“Adding a file extension to a language”部分:

    您可以使用 files.associations 设置为现有语言添加新的文件扩展名。

    例如,下面的设置将 .myphp 文件扩展名添加到 php 语言标识符中:

    "files.associations": {
        "*.myphp": "php"
    }
    

    IntelliSense (Ctrl+Space) 将显示可用的语言标识符。

    在你的情况下:

    "files.associations": {
        "*.kki": "c"
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-07-25
      • 1970-01-01
      • 2023-01-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-09
      • 1970-01-01
      相关资源
      最近更新 更多