CLANGD(1)
π NAME π
clangd β the manual page for clangd 19, bestie π
β¨ DESCRIPTION β¨
OVERVIEW: clangd is a language server that hands out IDE-like features to editors. It's giving brainpower-for-your-editor energy π§ β¨
π«Ά It should be used via an editor plugin rather than invoked directly π«Ά
Like, do NOT just run this raw, ok? It lives in your editor through a plugin. For more info, go look at:
clangd accepts flags on the commandline, and also in the CLANGD_FLAGS environment variable β yes, both, it's flexible like that π¦
πΈ USAGE πΈ
clangd [options]
π OPTIONS π
π Generic Options π
--helpβ shows u all the available options π₯° (there's--help-hiddenfor even more)--help-listβ shows u the list of available options (and--help-list-hiddenfor more)--versionβ tells u what version of this program ur running, iconic
π clangd compilation flags options π
--compile-commands-dir=<string>β points at a path to look forcompile_commands.json. If that path is invalid, clangd goes looking in the current directory and the parent paths of each source file instead π΅οΈββοΈ--query-driver=<string>β a comma separated list of globs white-listing gcc-compatible drivers that are safe to execute. Any driver matching one of these globs gets used to extract system includes. e.g./usr/bin/**/clang-*,/path/to/repo/**/g++-*π₯
π clangd feature options π
--all-scopes-completionβ if set to true, code completion will include index symbols that are not defined in the scopes (e.g. namespaces) visible from the code completion point. Such completions can insert scope qualifiers π«--background-indexβ indexes project code in the background and persists the index on disk. No cap.--background-index-priority=<value>β thread priority for building the background index. Heads up, the effect of this flag is OS-specific πbackgroundβ minimum priority, runs on idle CPUs. May leave 'performance' cores unused.lowβ reduced priority compared to interactive work.normalβ same priority as other clangd work.
--clang-tidyβ enables clang-tidy diagnostics π§Ό--completion-style=<value>β the granularity of code completion suggestions:detailedβ one completion item for each semantically distinct completion, with full type informationbundledβ similar completion items (e.g. function overloads) are combined. Type information shown where possible
--experimental-modules-supportβ experimental support for standard c++ modules π§ͺ (it literally says experimental, so, yk)--fallback-style=<string>β the clang-format style to apply by default when no.clang-formatfile is found--function-arg-placeholdersβ when disabled, completions contain only parentheses for function calls. When enabled, completions also contain placeholders for method parameters π«Ά--header-insertion=<value>β adds#includedirectives when accepting code completions:iwyuβ include what you use. Insert the owning header for top-level symbols, unless the header is already directly included or the symbol is forward-declaredneverβ never insert#includedirectives as part of code completion
--header-insertion-decoratorsβ prepends a circular dot or a space before the completion label, depending on whether an include line will be inserted or not π--import-insertionsβ if header insertion is enabled, adds#importdirectives when accepting code completions or fixing includes in Objective-C code--limit-references=<int>β limits the number of references returned by clangd.0means no limit (default=1000)--limit-results=<int>β limits the number of results returned by clangd.0means no limit (default=100)--project-root=<string>β path to the project root. Requiresremote-index-addressto be set β οΈ--remote-index-address=<string>β the address of the remote index server π--rename-file-limit=<int>β limits the number of files to be affected by symbol renaming.0means no limit (default=50)
π¦ clangd miscellaneous options π¦
--check[=<string>]β parses one file in isolation instead of acting as a language server. Super useful to investigate/reproduce crashes or configuration problems. With--check=<filename>, it attempts to parse that particular file π--enable-configβ reads user and project configuration from YAML files. Project config comes from a.clangdfile in the project directory. User config comes fromclangd/config.yamlin these directories:- Windows:
%USERPROFILE%\AppData\Local - Mac OS:
~/Library/Preferences/ - Others:
$XDG_CONFIG_HOME, usually~/.config
- Windows:
Configuration is documented at https://clangd.llvm.org/config.html π
-j <uint>β number of async workers used by clangd. The background index also uses this many workers πͺ--malloc-trimβ releases memory periodically viamalloc_trim(3).--pch-storage=<value>β storing PCHs in memory increases memory usages, but may improve performance π«diskβ store PCHs on diskmemoryβ store PCHs in memory
β clangd protocol and logging options β
--log=<value>β verbosity of log messages written to stderr:errorβ error messages onlyinfoβ high level execution tracingverboseβ low level details
--offset-encoding=<value>β forces theoffsetEncodingused for character positions. This bypasses negotiation via client capabilities π€utf-8β offsets are in UTF-8 bytesutf-16β offsets are in UTF-16 code unitsutf-32β offsets are in unicode codepoints
--path-mappings=<string>β translates between client paths (as seen by a remote editor) and server paths (where clangd sees files on disk). Comma separated list of'<client_path>=<server_path>'pairs, and the first entry matching a given path is the one used. e.g./home/project/incl=/opt/include,/home/project=/workarea/projectπΊοΈ--prettyβ pretty-prints JSON output πΈ
okay that's the whole thing bestie, u got this π This was the clangd(1) manual page for clangd 19, dated June 2025 β mwah, slay, periodt ππ
β¨
π¦ where this page comes from
- debian bookworm: clangd-19 1:19.1.7-3~deb12u1 Β· APACHE-2-LLVM-EXCEPTIONS
- debian trixie: clangd-19 1:19.1.7-3+b1 Β· APACHE-2-LLVM-EXCEPTIONS
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms