fbaeuerlein / cpp-vscode-guide Goto Github PK
View Code? Open in Web Editor NEWA small guide for C/C++ developers to useful extensions to unleash the power of Visual Studio Code
License: Creative Commons Zero v1.0 Universal
A small guide for C/C++ developers to useful extensions to unleash the power of Visual Studio Code
License: Creative Commons Zero v1.0 Universal
Clang tidy finds errors if the include paths are missing (e.g. at tests).
Find a possible configuration to avoid this
Evaluate IKOS (https://github.com/NASA-SW-VnV/ikos) and look for VSC integration.
e.g. add compiler flags
see: https://code.visualstudio.com/docs/cpp/config-msvc#_cc-configurations
Create workflow for coverage
Example for task:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Run lcov",
"type": "shell",
"command": "lcov --capture --directory .. --output-file lcov.info && lcov --remove lcov.info '/usr/*' '*/googletest/*' --output-file lcov.info",
"options": {
"cwd": "${workspaceFolder}/build" }
},
{
"label": "Run genhtml",
"type": "shell",
"command": "genhtml lcov.info --output-directory coverage",
"options": {
"cwd": "${workspaceFolder}/build" }
}
]
}
Together with TaskRunner extension a nice idea ...
Possible settings.json configuration
"clangd.semanticHighlighting": true,
"clangd.checkUpdates": true,
"clangd.arguments": [
"-clang-tidy",
"--compile-commands-dir=${workspaceFolder}/build",
"--header-insertion=iwyu",
// "--suggest-missing-includes",
"-log=verbose"
]
Seems not to work currently together with clang-tidy. No errors are displayed (e.g. nullptr deref). Maybe wait for update of ext or vscode.
Some rework necessary:
Extensions/Examples for working with legacy code bases
lcov --remove lcov.info '*/googletest/*' --output-file lcov.info
(considered in #8)Look for task/extension to run valgrind for tests
Maybe leave out, instead refer to sanitizers
Add links for sanitizer comparison: https://github.com/google/sanitizers/wiki/AddressSanitizerComparisonOfMemoryTools
Choosing two variants that define the same compiler flags are overwriting each other so that only one is used. Mention that in the documentation.
Some images are not displayed, maybe not resolved due to content length error of github referer
Link to test-source and codelens only works with gtest-1.8.0 or above!
Update description
mscgen:
- https://marketplace.visualstudio.com/items?itemName=arichika.previewseqdiag-vscode
- https://marketplace.visualstudio.com/items?itemName=mscgenjs.vscode-mscgen
plantuml:
- https://marketplace.visualstudio.com/items?itemName=jebbs.plantuml (included with 485ba3a)
Some sample:
buildType:
default: debug
choices:
debug:
short: Debug
long: Emit debug information
buildType: Debug
release:
short: Release
long: Optimize generated code
buildType: Release
instrumentation:
default: NoInstrumentation # no sanitizer/no instrumentation
choices:
NoSan:
short: NoInstrumentation
long: build without any instrumentation
Coverage:
short: Coverage
long: build with coverage instrumentation
settings:
CMAKE_CXX_FLAGS: "-fprofile-arcs -ftest-coverage "
CMAKE_C_FLAGS: "-fprofile-arcs -ftest-coverage"
CMAKE_EXE_LINKER_FLAGS: "--coverage"
ASan:
short: ASan
long: build with adresss sanitizer instrumentation
settings:
CMAKE_CXX_FLAGS: "-fsanitize=address -fno-omit-frame-pointer -fsanitize-address-use-after-scope"
CMAKE_C_FLAGS: "-fsanitize=address -fno-omit-frame-pointer -fsanitize-address-use-after-scope"
CMAKE_EXE_LINKER_FLAGS: "-fsanitize=address"
TSan:
short: TSan
long: build with thread sanitizer instrumentation
settings:
CMAKE_CXX_FLAGS: "-fsanitize=thread"
CMAKE_C_FLAGS: "-fsanitize=thread"
CMAKE_EXE_LINKER_FLAGS: "-fsanitize=thread"
Look for extension or create task
Add gist extension (PAT creation, etc.)
Some general description of Tasks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.