求助关于 VSCode Astyle 配置
  • 板块学术版
  • 楼主__er
  • 当前回复1
  • 已保存回复1
  • 发布时间2023/5/29 20:42
  • 上次更新2023/10/23 14:21:16
查看原帖
求助关于 VSCode Astyle 配置
713955
__er楼主2023/5/29 20:42

rt,看网上的教程说要把 bin 文件夹加到 Path 里然而我下载的 Astyle 是这样的,下载链接:https://sourceforge.net/projects/astyle/files/

然后我就把 astyle.exe 的父文件夹加到 Path 里面了,已经在 VSCode 中安装了 Astyle 扩展,这是配置文件 setting.json:

{
    "C_Cpp.default.compilerPath": "E:\\mingw\\bin\\gcc.exe",
    //"astyle.executable": "E:\\Astyle\\astyle.exe",
    "terminal.integrated.allowChords": false,
    "editor.fontLigatures": true,
    "editor.formatOnSave": true,
    "editor.fontFamily": "'FiraCode Nerd Font'",
    "workbench.colorTheme": "Github Dark Plus",
    "astyle.additional_languages": [
        "c",
        "cpp"
    ],
    "astyle.cmd_options": [
        "--style=java",
        "--indent=spaces=4",
        "--convert-tabs",
        "--align-pointer=name",
        "--align-reference=name",
        "--keep-one-line-statements",
        "--pad-header",
        "--pad-oper",
        "--indent-preprocessor",
        "--indent-namespaces",
        "--indent-classes",
        "--indent-switches",
        "--suffix=none"
    ],
    "[cpp]": {
        "editor.defaultFormatter": "chiehyu.vscode-astyle"
    },
    "[c]": {
        "editor.defaultFormatter": "chiehyu.vscode-astyle"
    },
}

不报错,但是点击格式化文档没有任何反应

2023/5/29 20:42
加载中...