Skip to content

IDE Setting

Aaron Robert edited this page Apr 25, 2020 · 2 revisions

For VSCode

Code format setting

  1. Install extension: Xaver: Clang-Format

  2. For Ubuntu: install clang-format

search clang-format with below command first:

sudo apt-cache search clang-format

Install which version you want to install such as:

sudo apt-get install clang-format-9
  1. In ./vscode/settings.json, set:
"clang-format.executable": "/usr/bin/clang-format-9"

You can use whereis clang-format-9 to locate your clang-format executable.

Debug setting

  1. In ./.vscode/launch.json:
{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Standalone",
      "type": "cppdbg",
      "request": "launch",
      "program": "${workspaceRoot}/build/standalone/Smark",
      "args": [],
      "stopAtEntry": false,
      "cwd": "${workspaceFolder}",
      "environment": [],
      "externalConsole": false,
      "MIMode": "gdb",
      "setupCommands": [
        {
          "description": "Enable pretty-printing for gdb",
          "text": "-enable-pretty-printing",
          "ignoreFailures": true
        }
      ],
      "preLaunchTask": "BuildStandalone"
    }
  ]
}
  1. In ./.vscode/tasks.json
{
  "tasks": [
    {
      "type": "shell",
      "label": "BuildStandalone",
      "command": "cmake -DCMAKE_CXX_FLAGS=-g -Hstandalone -Bbuild/standalone && cmake --build build/standalone",
      "options": {}
    }
  ],
  "version": "2.0.0"
}
Clone this wiki locally