.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. .TH CLANGD "1" "July 2023" "clangd 13" "User Commands" .SH NAME clangd \- manual page for clangd 13 .SH DESCRIPTION OVERVIEW: clangd is a language server that provides IDE\-like features to editors. .SS "It should be used via an editor plugin rather than invoked directly. For more information, see:" .IP https://clangd.llvm.org/ https://microsoft.github.io/language\-server\-protocol/ .PP clangd accepts flags on the commandline, and in the CLANGD_FLAGS environment variable. .PP USAGE: clangd [options] .PP OPTIONS: .PP Generic Options: .HP \fB\-\-help\fR \- Display available options (\fB\-\-help\-hidden\fR for more) .HP \fB\-\-help\-list\fR \- Display list of available options (\fB\-\-help\-list\-hidden\fR for more) .HP \fB\-\-version\fR \- Display the version of this program .PP clangd compilation flags options: .HP \fB\-\-compile\-commands\-dir=\fR \- Specify a path to look for compile_commands.json. If path is invalid, clangd will look in the current directory and parent paths of each source file .HP \fB\-\-query\-driver=\fR \- 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++\-* .PP clangd feature options: .HP \fB\-\-all\-scopes\-completion\fR \- 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 .HP \fB\-\-background\-index\fR \- Index project code in the background and persist index on disk. .HP \fB\-\-clang\-tidy\fR \- Enable clang\-tidy diagnostics .HP \fB\-\-completion\-style=\fR \- Granularity of code completion suggestions .TP =detailed \- One completion item for each semantically distinct completion, with full type information .TP =bundled \- Similar completion items (e.g. function overloads) are combined. Type information shown where possible .HP \fB\-\-fallback\-style=\fR \- clang\-format style to apply by default when no .clang\-format file is found .HP \fB\-\-header\-insertion=\fR \- Add #include directives when accepting code completions .TP =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 .TP =never \- Never insert #include directives as part of code completion .HP \fB\-\-header\-insertion\-decorators\fR \- Prepend a circular dot or space before the completion label, depending on whether an include line will be inserted or not .HP \fB\-\-inlay\-hints\fR \- Enable preview of InlayHints feature .HP \fB\-\-limit\-references=\fR \- Limit the number of references returned by clangd. 0 means no limit (default=1000) .HP \fB\-\-limit\-results=\fR \- Limit the number of results returned by clangd. 0 means no limit (default=100) .HP \fB\-\-project\-root=\fR \- Path to the project root. Requires remote\-index\-address to be set. .HP \fB\-\-remote\-index\-address=\fR \- Address of the remote index server .PP clangd miscellaneous options: .HP \fB\-\-check[=\fR] \- Parse one file in isolation instead of acting as a language server. Useful to investigate/reproduce crashes or configuration problems. With \fB\-\-check=\fR, attempts to parse a particular file. .HP \fB\-\-check\-lines[=\fR] \- If specified, limits the range of tokens in \fB\-check\fR file on which various features are tested. Example \fB\-\-check\-lines\fR=\fI\,3\-7\/\fR restricts testing to lines 3 to 7 (inclusive) or \fB\-\-check\-lines\fR=\fI\,5\/\fR to restrict to one line. Default is testing entire file. .TP \fB\-\-enable\-config\fR \- Read user and project configuration from YAML files. Project config is from a .clangd file in the project directory. User config is from clangd/config.yaml in the following directories: .TP Windows: %USERPROFILE%\eAppData\eLocal Mac OS: ~/Library/Preferences/ Others: $XDG_CONFIG_HOME, usually ~/.config .IP Configuration is documented at https://clangd.llvm.org/config.html .HP \fB\-j=\fR \- Number of async workers used by clangd. Background index also uses this many workers. .HP \fB\-\-malloc\-trim\fR \- Release memory periodically via malloc_trim(3). .HP \fB\-\-pch\-storage=\fR \- Storing PCHs in memory increases memory usages, but may improve performance .TP =disk \- store PCHs on disk .TP =memory \- store PCHs in memory .PP clangd protocol and logging options: .HP \fB\-\-log=\fR \- Verbosity of log messages written to stderr .TP =error \- Error messages only .TP =info \- High level execution tracing .TP =verbose \- Low level details .HP \fB\-\-offset\-encoding=\fR \- Force the offsetEncoding used for character positions. This bypasses negotiation via client capabilities .TP =utf\-8 \- Offsets are in UTF\-8 bytes .TP =utf\-16 \- Offsets are in UTF\-16 code units .TP =utf\-32 \- Offsets are in unicode codepoints .HP \fB\-\-path\-mappings=\fR \- Translates between client paths (as seen by a remote editor) and server paths (where clangd sees files on disk). Comma separated list of '=' pairs, the first entry matching a given path is used. e.g. /home/project/incl=/opt/include,/home/project=/workarea/project .HP \fB\-\-pretty\fR \- Pretty\-print JSON output