CLANGD(1)
π
CLANGD(1) β ok so this is the manual page for clangd 14 β¨
Bestie. Sit down. We're learning clangd and it's gonna be iconic.
π¦ NAME π¦
clangd β literally the manual page for clangd 14, no cap
πΈ DESCRIPTION πΈ
OVERVIEW: clangd is a language server that hands your editor all those IDE-ish features you're obsessed with. It's giving β¨main character energyβ¨ for your code.
π«Ά how to actually use it (please read this part)
Use it via an editor plugin, not by yelling at it directly in your terminal. Like, don't invoke it yourself, ok? For more info, go look at:
https://clangd.llvm.org/
https://microsoft.github.io/language-server-protocol/
clangd takes flags on the commandline, and it also reads them from the CLANGD_FLAGS environment variable. Both. She's flexible like that π
usage
π OPTIONS π
β¨ Generic Options β¨
--helpβ Display available options (--help-hiddenfor more)--help-listβ Display list of available options (--help-list-hiddenfor more)--versionβ Display the version of this program
π₯ clangd compilation flags options π₯
--compile-commands-dir=<string>β Specify a path to look forcompile_commands.json. If that path is invalid,clangdwill look in the current directory and parent paths of each source file. So it's got a backup plan, she's prepared π--query-driver=<string>β A comma separated list of globs for white-listing gcc-compatible drivers that are safe to execute. Drivers matching any of these globs will be 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. Sneaky little qualifiers, love that for them.--background-indexβ Index project code in the background and persist index on disk.--clang-tidyβ Enableclang-tidydiagnostics--completion-style=<value>β Granularity of code completion suggestions=detailedβ One completion item for each semantically distinct completion, with full type information=bundledβ Similar completion items (e.g. function overloads) are combined. Type information shown where possible
--fallback-style=<string>βclang-formatstyle 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>β Add#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-declared=neverβ Never insert#includedirectives as part of code completion
--header-insertion-decoratorsβ Prepend a circular dot or space before the completion label, depending on whether an include line will be inserted or not. Cute lil dot. Dot is the vibe check π--limit-references=<int>β Limit the number of references returned byclangd.0means no limit (default=1000)--limit-results=<int>β Limit the number of results returned byclangd.0means no limit (default=100)--project-root=<string>β Path to the project root. Requiresremote-index-addressto be set.--remote-index-address=<string>β Address of the remote index server
π§ clangd miscellaneous options π§
--check[=<string>]β Parse one file in isolation instead of acting as a language server. Useful to investigate/reproduce crashes or configuration problems. With--check=<filename>, attempts to parse a particular file. Lowkey the detective mode fr fr π--check-lines[=<string>]β If specified, limits the range of tokens in-checkfile on which various features are tested. Example--check-lines=3-7restricts testing to lines 3 to 7 (inclusive) or--check-lines=5to restrict to one line. Default is testing entire file.--enable-configβ Read user and project configuration from YAML files. Project config is from a.clangdfile in the project directory. User config is fromclangd/config.yamlin the following 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 byclangd. Background index also uses this many workers.--malloc-trimβ Release memory periodically viamalloc_trim(3).--pch-storage=<value>β Storing PCHs in memory increases memory usages, but may improve performance=diskβ store PCHs on disk=memoryβ store PCHs in memory
π clangd protocol and logging options π
--log=<value>β Verbosity of log messages written tostderr=errorβ Error messages only=infoβ High level execution tracing=verboseβ Low level details
--offset-encoding=<value>β Force theoffsetEncodingused for character positions. This bypasses negotiation via client capabilities=utf-8β Offsets are in UTF-8 bytes=utf-16β Offsets are in UTF-16 code units=utf-32β Offsets are in unicode codepoints
--path-mappings=<string>β Translates between client paths (as seen by a remote editor) and server paths (whereclangdsees files on disk). Comma separated list of'<client_path>=<server_path>'pairs, the first entry matching a given path is used. e.g./home/project/incl=/opt/include,/home/project=/workarea/project--prettyβ Pretty-print JSON output
π That's the whole list. Every single one. Not skipping a single flag, periodt.
And that's a wrap, bestie! This was the manual page for clangd 14, dated May 2025, from the User Commands section β so go forth, let your editor be β¨iconicβ¨, and remember: use the plugin. Slay. π π¦π
π¦ where this page comes from
- ubuntu questing: clangd-14 1:14.0.6-20ubuntu3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms