Skip to content

Instantly share code, notes, and snippets.

@mrowrpurr
Last active December 9, 2022 00:04
Show Gist options
  • Save mrowrpurr/115da9a36df760062a838a5c8d03ad3d to your computer and use it in GitHub Desktop.
Save mrowrpurr/115da9a36df760062a838a5c8d03ad3d to your computer and use it in GitHub Desktop.
Clang for VS Code / C++ on Windows
---
AccessModifierOffset: -4
BasedOnStyle: Google
ColumnLimit: 180
IndentWidth: '4'
NamespaceIndentation: All
TabWidth: '4'
UseTab: Always
IndentPPDirectives: BeforeHash
FixNamespaceComments: false
...
FormatStyle: google
CheckOptions:
- key: misc-definitions-in-headers.HeaderFileExtensions
value: ''
- key: misc-definitions-in-headers.UseHeaderFileExtension
value: '1'
# ...
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
{
"name": "clang",
"hidden": true,
"generator": "Ninja",
"cacheVariables": {
"CMAKE_C_COMPILER": "clang-cl",
"CMAKE_CXX_COMPILER": "clang-cl",
"CMAKE_CXX_FLAGS": "/std:c++20 /permissive- /EHsc -Wno-overloaded-virtual -Wno-delete-non-abstract-non-virtual-dtor -D__cpp_lib_char8_t -D__cpp_consteval -D__cpp_lib_format -DWIN32_LEAN_AND_MEAN -DNOMINMAX -DUNICODE -D_UNICODE -D_CRT_SECURE_NO_WARNINGS -DCMAKE_EXPORT_COMPILE_COMMANDS"
},
"vendor": {
"microsoft.com/VisualStudioSettings/CMake/1.0": {
"intelliSenseMode": "windows-clang-x64",
"enableMicrosoftCodeAnalysis": true,
"enableClangTidyCodeAnalysis": true
}
}
},
"editor.formatOnSave": true,
"clangd.arguments": [
"--compile-commands-dir=${workspaceFolder}/build/Debug",
"--completion-style=detailed",
"--header-insertion=never"
],
"C_Cpp.intelliSenseEngine": "disabled",
"[cpp]": {
"editor.wordBasedSuggestions": false,
"editor.suggest.insertMode": "replace",
"editor.semanticHighlighting.enabled": true,
"editor.codeActionsOnSave": {
"source.fixAll": true
},
"editor.formatOnSave": true,
"editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment