Skip to content

Instantly share code, notes, and snippets.

@levihuayuzhang
Last active January 14, 2024 04:11
Show Gist options
  • Save levihuayuzhang/838645a84c83ad738fb5c03dd9dc09b0 to your computer and use it in GitHub Desktop.
Save levihuayuzhang/838645a84c83ad738fb5c03dd9dc09b0 to your computer and use it in GitHub Desktop.
clangd configuration
Checks: 'clang-analyzer-*,bugprone-*,modernize-*,performance-*,portability-*,readability-*,cert-*,cppcoreguidelines-*,google-*,llvm-*'
FormatStyle: llvm
# https://clangd.llvm.org/config
Diagnostics:
ClangTidy:
Add:
[
clang-analyzer-*,
cppcoreguidelines-*,
bugprone-*,
performance-*,
modernize-*,
portability-*,
readability-*',
cert-*,
llvm-*,
google-*,
]
Remove:
[
modernize-use-trailing-return-type,
cppcoreguidelines-avoid-magic-numbers,
]
CheckOptions:
WarnOnFloatingPointNarrowingConversion: false
# https://clangd.llvm.org/config
CompileFlags:
Add: [-ferror-limit=0, -Wall]
InlayHints:
Enabled: Yes
ParameterNames: Yes
Designators: Yes
DeducedTypes: Yes
# BlockEnd: Yes
# TypeNameLimit: 24
Hover:
ShowAKA: Yes
Diagnostics:
UnusedIncludes: Strict
# MissingIncludes: Strict
// vscode clangd extention settings
"clangd.arguments": [
"--background-index",
"-j=16",
"--clang-tidy",
// "--compile-commands-dir=build",
// "--query-driver=/usr/bin/clang++",
"--all-scopes-completion",
"--completion-style=detailed",
"--header-insertion=iwyu",
"--pch-storage=memory",
"--offset-encoding=utf-8",
"--fallback-style=LLVM",
// "--log=verbose"
],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment