This documentation shows how to configure VS Code to enhance the look and structure of your code with extensions.
Installing clang-format:
apt install clang-format
To use clang-format within VS Code, you need to install the clang-format extension and place a .clang-format
within your workspace root directory.
To run the formatter, press Ctrl+Shift+I
. Maybe you have to choose the right formatter on first usage.
A sample .clang-format
file could be found in the project root.
Include what you use helps you to reduce inclusions of header files and thus can help you to speed up compilation time and also can lead to fewer recompiles.
To use it under Linux (Ubuntu/Debian) just install by:
apt install iwyu
To run it for the currently opened file from VS Code, install the Include what you use extension.
Initially you have to add at least the following entries to you settings.json
:
"iwyu.exe": "/usr/bin/iwyu",
"iwyu.compile_commands": "${workspaceFolder}/build/compile_commands.json"
For more details see https://github.com/include-what-you-use/include-what-you-use
Especially when you want to keep certain includes, this site gives you an overview of pragmas that turn off IWYU.