### Clangd Log: Editor Start Flags Source: https://clangd.llvm.org/design/compile-commands Example log output showing flags passed when the clangd editor service starts. ```log I[...] argv[1]: --log=verbose ``` -------------------------------- ### Install clangd on Debian/Ubuntu Source: https://clangd.llvm.org/installation.html Installs a specific version of clangd using apt-get. If the specified version is not found, it suggests trying older versions. ```bash sudo apt-get install clangd-12 ``` -------------------------------- ### Fallback Compile Command Example Source: https://clangd.llvm.org/design/compile-commands A very basic compile command used when no compilation database is found, allowing clangd to work on simple examples. ```bash clang foo.cc ``` -------------------------------- ### Basic Neovim LSP configuration for clangd Source: https://clangd.llvm.org/installation.html Sets up clangd as a language server in Neovim using the nvim-lspconfig plugin. This example shows configurations for both older (<=0.10.x) and newer (>=0.11.x) versions of Neovim. ```lua -- Leaving this empty will use the default options from the -- `nvim-lspconfig` plugin. See |:h vim.lsp.Config| for all -- available fields, and see below for more customization. local clangd_opts = {} -- ------------------------------------------ -- -- For version 0.10.x and below: require('lspconfig').clangd.setup(clangd_opts) -- ------------------------------------------ -- -- For version 0.11.x and above: if not vim.lsp.is_enabled('clangd') then vim.lsp.enable('clangd', clangd_opts) end ``` -------------------------------- ### Example Compiler Command Source: https://clangd.llvm.org/design/compile-commands A typical command-line invocation for a C++ compiler, demonstrating various flags used to provide context. ```bash clang -x objective-c++ -I/path/headers --target=x86_64-pc-linux-gnu -DNDEBUG foo.mm ``` -------------------------------- ### Run clangd-index-server Source: https://clangd.llvm.org/guides/remote-index Start the index server using the generated index file and the project's root directory. It listens on port 50051 by default and reloads the index when the file is updated. ```bash clangd-index-server proj.idx /proj ``` -------------------------------- ### Advanced Conditional Configuration with Path Matching and Exclusion Source: https://clangd.llvm.org/config.html This example demonstrates applying configuration to headers or C files, excluding those within an 'internal' directory, and adding a preprocessor definition. ```yaml # ... Prior fragments --- If: # Apply this config conditionally PathMatch: [.*\.h, .* .c] # to all headers OR c files PathExclude: internal/.* CompileFlags: Add: [-DEXTERNAL] --- # ... Further fragments ``` -------------------------------- ### Install clangd with Homebrew on macOS Source: https://clangd.llvm.org/installation.html Installs clangd along with LLVM using the Homebrew package manager. ```bash brew install llvm ``` -------------------------------- ### Install clangd with MacPorts Source: https://clangd.llvm.org/installation.html Installs a specific version of clangd using the MacPorts package manager. ```bash sudo port install clang-11 ``` -------------------------------- ### Example clangd Configuration File Source: https://clangd.llvm.org/faq Use this YAML configuration for clangd to set compile flags, manage diagnostics, and configure remote indexing. It supports conditional settings based on file paths. ```yaml CompileFlags: # Treat code as C++, use C++17 standard, enable more warnings. Add: [-xc++, -std=c++17, -Wall, -Wno-missing-prototypes] # Remove extra warnings specified in compile commands. # Single value is also acceptable, same as "Remove: [-mabi]" Remove: -mabi Diagnostics: # Tweak Clang-Tidy checks. ClangTidy: Add: [performance*, modernize*, readability*] Remove: [modernize-use-trailing-return-type] CheckOptions: readability-identifier-naming.VariableCase: CamelCase --- # Use Remote Index Service for LLVM. If: # Note: This is a regexp, notice '.*' at the end of PathMatch string. PathMatch: /path/to/llvm/.* Index: External: Server: clangd-index.llvm.org:5900 MountPoint: /path/to/llvm/ ``` -------------------------------- ### Compile Command: Target Platform Flag Source: https://clangd.llvm.org/design/compile-commands An example flag for changing the target platform, affecting built-in types like 'long'. ```bash --target=x86_64-pc-linux-gnu ``` -------------------------------- ### Compilation Database: compile_flags.txt Example Source: https://clangd.llvm.org/design/compile-commands A text file format listing flags to be used for all files, typically hand-authored for simpler projects. ```text compile_flags.txt ``` -------------------------------- ### Customize clangd behavior in Neovim Source: https://clangd.llvm.org/installation.html Customizes clangd's behavior by passing additional command-line flags and initialization options. This example enables background indexing and clang-tidy, and sets the C++ standard to C++17. ```lua local clangd_opts = { -- Add custom command-line flags: cmd = { 'clangd', '--background-index', '--clang-tidy' }, -- Customize clangd's behaviour: init_options = { fallbackFlags = { '-std=c++17' } }, } ``` -------------------------------- ### Example clangd Stack Trace Source: https://clangd.llvm.org/troubleshooting A raw stack trace from a clangd crash. This output is difficult to interpret without symbolization. ```text /home/me/bin/clangd[0x4f626c] /lib/x86_64-linux-gnu/libpthread.so.0(+0x13520)[0x7fb6b93c3520] /home/me/bin/clangd[0x12cc8d2] ... ``` -------------------------------- ### Configure YouCompleteMe for clangd in Vim Source: https://clangd.llvm.org/installation.html Disable YCM's caching and specify the path to the installed clangd binary for YouCompleteMe. ```vim " Let clangd fully control code completion let g:ycm_clangd_uses_ycmd_caching = 0 " Use installed clangd, not YCM-bundled clangd which doesn't get updates. let g:ycm_clangd_binary_path = exepath("clangd") ``` -------------------------------- ### Set clangd as default on Debian/Ubuntu Source: https://clangd.llvm.org/installation.html Sets the installed clangd version as the system's default clangd executable using update-alternatives. ```bash sudo update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-12 100 ``` -------------------------------- ### Example of unused include diagnostic Source: https://clangd.llvm.org/design/include-cleaner This example demonstrates how Include Cleaner flags an unused header. `bar.h` is included but its symbols are not used in `main.cpp`, so it's marked as removable. ```c++ #pragma once class Foo {}; ``` ```c++ #pragma once class Bar {}; ``` ```c++ #include "foo.h" #include "bar.h" // <- Will be marked as unused and suggested to be removed. int main() { Foo f; } ``` -------------------------------- ### Compile Command: Warning Control Flags Source: https://clangd.llvm.org/design/compile-commands Examples of flags used to control compiler warnings. ```bash -Wall, -Wswitch, -Wno-switch, -Werror ``` -------------------------------- ### Compilation Database: compile_commands.json Example Source: https://clangd.llvm.org/design/compile-commands A JSON file format used by build systems like CMake to describe compile commands for each file in a codebase. ```json compile_commands.json ``` -------------------------------- ### Clangd Log: ASTWorker File Processing Source: https://clangd.llvm.org/design/compile-commands Example log output when clangd's ASTWorker processes a file, showing the constructed compile command. ```log I[...] ASTWorker building file /path/test.cc version 1 with command [/path] /usr/bin/clang /path/test.cc -DNDEBUG -fsyntax-only -resource-dir=/usr/lib/clang/12/ ``` -------------------------------- ### Symbol usage detection in Include Cleaner Source: https://clangd.llvm.org/design/include-cleaner This example shows how Include Cleaner identifies used symbols, including those brought in via macros, implicit types, or templates. All referenced symbols and their declarations are marked as 'used'. ```c++ #pragma once // USED int foo(); // USED #define FOO foo // USED struct Bar { Bar(); } // USED struct Baz; // USED template Baz getBaz(); ``` ```c++ #include "foo.h" int main() { // Uses foo() and FOO FOO(); // Uses Baz, getBaz and Bar. auto baz = getBaz(); } ``` -------------------------------- ### Build Project Index with clangd-indexer Source: https://clangd.llvm.org/guides/remote-index Periodically generate an index file for your project using `clangd-indexer`. This command requires a `compile_commands.json` file and outputs an index file. ```bash clangd-indexer --executor=all-TUs /proj/compile_commands.json > proj.idx ``` -------------------------------- ### Configure Inlay Hints Behavior Source: https://clangd.llvm.org/config.html Sets the default behavior for inlay hints, including parameter names, deduced types, and designators. Ensure 'Enabled' is true to activate these hints. ```yaml InlayHints: BlockEnd: false Designators: true Enabled: true ParameterNames: true DeducedTypes: true DefaultArguments: false TypeNameLimit: 24 ``` -------------------------------- ### Configure coc-clangd in coc.nvim Source: https://clangd.llvm.org/installation.html Set the path to the clangd binary, additional arguments, and fallback flags for coc-clangd. ```json { "clangd.path": "/path/to/custom/clangd", "clangd.arguments": ["--background-index", "--clang-tidy"], "clangd.fallbackFlags": ["-std=c++23"] } ``` -------------------------------- ### Configure clangd logging in Neovim Source: https://clangd.llvm.org/installation.html Set up clangd to log verbose output to a custom file path using `CLANGD_TRACE` environment variable. ```lua local clangd_opts = { cmd = { 'clangd', '--log=verbose' }, cmd_env = { -- Instructs clangd to write its log to this file: CLANGD_TRACE = '/my/custom/path/to/clangd.log', }, } ``` -------------------------------- ### Enable Standard Library Indexing Source: https://clangd.llvm.org/config.html Eagerly index the standard library to provide code completions for standard library symbols, even in an empty file. This is the default behavior. ```yaml Index: StandardLibrary: true ``` -------------------------------- ### Query Compiler Driver with Clangd Source: https://clangd.llvm.org/guides/system-headers This command demonstrates how clangd can query an external compiler to determine header search paths. It's a fallback mechanism when clang's heuristics are insufficient for custom toolchains. ```bash clangd --query-driver="/path/to/my/project/arm-g*,/path/to/other/project/gcc" ``` -------------------------------- ### Generate Compile Commands with Bear (3.0.x) Source: https://clangd.llvm.org/installation.html For `make`-based builds, use Bear version 3.0.x to record build commands and generate `compile_commands.json`. This command also performs a clean build. ```bash make clean; bear -- make ``` -------------------------------- ### Configure clangd to use project's compile commands for all files Source: https://clangd.llvm.org/faq Instructs clangd to use the project's compilation database for all files, including those outside the project directory. This is useful when headers are in external locations. ```bash --compile-commands-dir= ``` -------------------------------- ### Generate Compile Commands with Bear (2.4.x) Source: https://clangd.llvm.org/installation.html For `make`-based builds, use Bear version 2.4.x to record build commands and generate `compile_commands.json`. This command also performs a clean build. ```bash make clean; bear make ``` -------------------------------- ### clangdInlayHintsProvider Capability Source: https://clangd.llvm.org/extensions This section describes the `clangdInlayHintsProvider` server capability, which signals that the server supports the `clangd/inlayHints` requests. ```APIDOC ## clangdInlayHintsProvider Server Capability ### Description This capability indicates that the language server supports the `clangd/inlayHints` request, allowing it to provide inlay hints to the client. ### Capability `clangdInlayHintsProvider : bool` ``` -------------------------------- ### Configure Code Completion Settings Source: https://clangd.llvm.org/config.html Set various code completion behaviors, including scope visibility, argument list placeholders, header insertion, and code pattern suggestions. ```yaml Completion: AllScopes: Yes ArgumentLists: FullPlaceholders HeaderInsertion: IWYU CodePatterns: All MacroFilter: ExactPrefix ``` -------------------------------- ### Configure External Index Source Source: https://clangd.llvm.org/config.html Define an external index source, either a monolithic index file or a remote server address. MountPoint specifies the source root for the index. ```yaml Index: External: File: /abs/path/to/an/index.idx # OR Server: my.index.server.com:50051 MountPoint: /files/under/this/project/ ``` -------------------------------- ### Configure Include Diagnostics Source: https://clangd.llvm.org/guides/include-cleaner This configuration snippet shows how to set include diagnostic levels and ignore specific headers for a given file path. ```yaml If: PathMatch: .*/project1/.*\.cpp Diagnostics: UnusedIncludes: Strict MissingIncludes: Strict Includes: IgnoreHeader: Python\.h ``` -------------------------------- ### Compile Command: Predefined Macro Flags Source: https://clangd.llvm.org/design/compile-commands Shows flags for predefining preprocessor macros. ```bash -D ``` -------------------------------- ### Compile Command: Include Path Flags Source: https://clangd.llvm.org/design/compile-commands Demonstrates critical flags for setting include search paths in a compile command. ```bash -I, -isystem ``` -------------------------------- ### Use a custom clangd binary in Neovim Source: https://clangd.llvm.org/installation.html Specifies a custom path to the clangd executable in Neovim's configuration. This is useful for using a locally compiled version or one not in the system's PATH. ```lua local clangd_opts = { cmd = { '/my/custom/clangd' }, } ``` -------------------------------- ### Compilation commands Source: https://clangd.llvm.org/extensions Allows editors to supply compilation commands over LSP instead of relying solely on `compile_commands.json`. ```APIDOC ## Compilation commands ### Description clangd relies on having accurate compilation commands to correctly interpret a file. These extensions allow editors to supply the commands over LSP instead. ### Initialization Option #### `initializationOptions.compilationDatabasePath` - **Type**: `string` - **Description**: Specifies the directory containing the compilation database (e.g. `compile_commands.json`). This path will be used for all files, instead of searching their ancestor directories. #### `initializationOptions.fallbackFlags` - **Type**: `string[]` - **Description**: Controls the flags used when no specific compile command is found. The compile command will be approximately `clang $FILE $fallbackFlags` in this case. ### Configuration Setting #### `settings.compilationDatabaseChanges` - **Type**: `{string: CompileCommand}` - **Description**: Provides compile commands for files. This can also be provided on startup as `initializationOptions.compilationDatabaseChanges`. - Keys are file paths (Not URIs!) - Values are `{workingDirectory: string, compilationCommand: string[]}` ``` -------------------------------- ### Configure file logging for coc-clangd Source: https://clangd.llvm.org/installation.html Set the path for coc-clangd to write server logs to a specified file. ```json { "clangd.trace.file": "/tmp/clangd.log" } ``` -------------------------------- ### Query Compiler Configuration Source: https://clangd.llvm.org/design/compile-commands Use this command to query a compiler for its default configuration, including target and header search paths. This helps clangd adjust compile commands to match custom toolchains. ```bash $ custom-gcc -E -v -x c++ /dev/null Target: arm-linux-gnueabihf ... #include <...> search starts here: /opt/custom-gcc/include/c++/10 ... End of search list. ``` -------------------------------- ### clangd/inlayHints Request Source: https://clangd.llvm.org/extensions This section describes the `clangd/inlayHints` request, which allows clients to ask the server for inlay hints to be displayed in the editor. ```APIDOC ## clangd/inlayHints Request ### Description This request allows clients to retrieve inlay hints for a specific text document or range. Inlay hints are labels displayed inline with the code, such as parameter names or type annotations. ### Method `clangd/inlayHints` ### Parameters - `InlayHintsParams` (object) - Required - `textDocument` (TextDocumentIdentifier) - Required - The document to inspect. - `range` (Range?) - Optional - The region of the source code to retrieve hints for. If not set, returns hints for the whole document. ### Result `InlayHints[]` - An array of inlay hints. Each `InlayHint` object has the following properties: - `kind` (string) - The type of hint, e.g., "parameter", "type". - `label` (string) - The text to display for the hint, e.g., "dest:". - `position` (Position) - The location where the hint should be displayed. - `range` (Range) - The source code range associated with the hint. ``` -------------------------------- ### Investigate System Header Search with -v Source: https://clangd.llvm.org/guides/system-headers Use the -v flag with clang to see the directories it searches for system headers. This helps in diagnosing header lookup issues. ```bash clang -v -c -xc++ /dev/null ``` -------------------------------- ### Configure clangd to Skip Indexing Folders Source: https://clangd.llvm.org/faq Configure clangd to skip indexing specific directories by setting 'Background' to 'Skip' within an 'If' block that matches the target path. ```yaml If: # Note: This is a regexp, notice '.*' at the end of PathMatch string. PathMatch: /my/project/large/dir/.* Index: # Disable slow background indexing of these files. Background: Skip ``` -------------------------------- ### Enable verbose logging for coc-clangd Source: https://clangd.llvm.org/installation.html Configure coc-clangd to output verbose server traces to the 'clangd' output channel. ```json { "clangd.trace.server": "verbose" } ``` -------------------------------- ### Configure clangd for Remote Index Source: https://clangd.llvm.org/guides/remote-index Add this configuration to your user settings to point clangd to a remote index server. Ensure `PathMatch` correctly identifies your project's source code. ```yaml If: PathMatch: /path/to/code/.* Index: External: Server: someserver:5900 MountPoint: /path/to/code/ ``` -------------------------------- ### Switch between source/header Source: https://clangd.llvm.org/extensions Allows editors to switch between the main source file (*.cpp) and its corresponding header (*.h). ```APIDOC ## Switch between source/header ### Description Lets editors switch between the main source file (`*.cpp`) and header (`*.h`). ### Method `textDocument/switchSourceHeader` (Client -> Server Request) ### Parameters #### Request Body - **TextDocumentIdentifier** (object) - Required - An open file. ### Response #### Success Response (200) - **string** - The URI of the corresponding header (if a source file was provided) or source file (if a header was provided). Returns `""` if the corresponding file cannot be determined. ``` -------------------------------- ### Configure Clang-Tidy Check Options Source: https://clangd.llvm.org/config.html Set specific options for clang-tidy checks. The format differs from .clang-tidy files, using key-value pairs directly. ```yaml Diagnostics: ClangTidy: CheckOptions: readability-identifier-naming.VariableCase: CamelCase ``` -------------------------------- ### Conditional Configuration with Path Matching in Clangd Source: https://clangd.llvm.org/config.html Use 'If' conditions to apply configuration fragments based on file paths. 'PathMatch' specifies patterns that must match, while 'PathExclude' specifies patterns that must not match. ```yaml If: # Apply this config conditionally PathMatch: .* # to all headers... PathExclude: include/llvm-c/.* ``` -------------------------------- ### C++ Code with Contextual Questions Source: https://clangd.llvm.org/design/compile-commands Illustrates code snippets where compiler context is needed for accurate interpretation, such as resolving include paths or determining type sizes. ```c++ #include // which file is this, exactly? char data[sizeof(int)]; // how big is this array? @class Foo; // objective-C, or just a syntax error? ``` -------------------------------- ### Set clangd command-line arguments in YouCompleteMe Source: https://clangd.llvm.org/installation.html Define custom command-line arguments for clangd within YouCompleteMe configuration. ```vim let g:ycm_clangd_args = ['-log=verbose', '-pretty'] ``` -------------------------------- ### Display Default Arguments as Inlay Hints Source: https://clangd.llvm.org/config.html Enables inlay hints for default arguments in function calls. This visually shows the default values being used when arguments are omitted. ```yaml InlayHints: DefaultArguments: false ``` -------------------------------- ### Symlink Compile Commands JSON Source: https://clangd.llvm.org/installation.html If your build directory is not in a standard location, create a symbolic link to `compile_commands.json` in your project's root directory. This ensures clangd can find it. ```bash ln -s ~/myproject-build/compile_commands.json ~/myproject/ ``` -------------------------------- ### Compile Command: Language Variant Flags Source: https://clangd.llvm.org/design/compile-commands Illustrates flags used to control the language variant and standard for compilation. ```bash -x, -std ``` -------------------------------- ### Configure Compile Flags Source: https://clangd.llvm.org/config.html Tweak parse settings by adding or removing compiler flags, and specify the compiler executable. Use this to control how clangd interprets source files. ```yaml CompileFlags: Add: [-xc++, -Wall] # treat all files as C++, enable more warnings Remove: [-W*] # strip all other warning-related flags Compiler: clang++ # Change argv[0] of compile flags to `clang++` ``` -------------------------------- ### Specify Compilation Database Directory Source: https://clangd.llvm.org/config.html Set the directory for clangd to search for compilation databases like compile_commands.json. Defaults to searching parent directories. ```yaml CompilationDatabase: /path/to/build ``` -------------------------------- ### Mark Header as Private Source: https://clangd.llvm.org/guides/include-cleaner Use this pragma to indicate that a header is an internal implementation detail and users should include a different, public header instead. ```c++ // in "private.h" // IWYU pragma: private; include "public.h" ``` -------------------------------- ### Add Headers to clangd Include Path Source: https://clangd.llvm.org/faq Use the 'CompileFlags.Add' option in your clangd configuration to include individual headers or entire directories, making them visible to clangd. ```yaml CompileFlags: Add: [--include=/headers/file.h, -I/other/headers] ``` -------------------------------- ### Configure Semantic Token Highlighting Source: https://clangd.llvm.org/config.html Allows customization of semantic highlighting by specifying which token kinds and modifiers should be disabled and not sent to the client. ```yaml SemanticTokens: DisabledKinds: [] DisabledModifiers: [] ``` -------------------------------- ### Check Clangd Compile Flags Source: https://clangd.llvm.org/guides/system-headers Execute this command to inspect the compile flags clangd is using for a specific file. This helps in debugging issues where clangd cannot find necessary headers, especially when using a compilation database. ```bash clangd --check=/path/to/a/file/in/your/project.cc ``` -------------------------------- ### Configure Documentation Comment Format Source: https://clangd.llvm.org/config.html Determines how code documentation comments are interpreted and formatted for display in hover and code completion. Choose between Plaintext, Markdown, or Doxygen. ```yaml Documentation: CommentFormat: Plaintext ``` -------------------------------- ### Check Target Triple Effects on Header Search Source: https://clangd.llvm.org/guides/system-headers Use this command to observe how specifying a target triple affects clang's header search paths. This is useful for understanding how clang locates platform-specific headers. ```bash clang --target=x86_64-w64-mingw32 -xc++ -v -c /dev/null ``` -------------------------------- ### Configure Clang-Tidy Checks Source: https://clangd.llvm.org/config.html Define which clang-tidy checks to add or remove, supporting globs for broad application. This configuration takes precedence over .clang-tidy files. ```yaml Diagnostics: ClangTidy: Add: modernize* Remove: modernize-use-trailing-return-type ``` -------------------------------- ### Enable CMake Export Compile Commands Source: https://clangd.llvm.org/installation.html Use this CMake flag to generate the `compile_commands.json` file for your project. This file is essential for clangd to understand your project's build settings. ```bash cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ``` -------------------------------- ### Control Background Indexing Source: https://clangd.llvm.org/config.html Disable slow background indexing for files to improve performance. The default is to build in the background. ```yaml Index: Background: Skip # Disable slow background indexing of these files. ``` -------------------------------- ### $/memoryUsage Source: https://clangd.llvm.org/extensions Requests a hierarchical view of memory usage within clangd. This helps in understanding where memory is being consumed by different components. ```APIDOC ## $/memoryUsage ### Description Requests a hierarchical view of memory usage within clangd. This helps in understanding where memory is being consumed by different components. ### Method `$/memoryUsage` ### Parameters #### Request Body - **none** ### Response #### Success Response (200) - **_total** (number) - Number of bytes used, including child components. - **_self** (number) - Number of bytes used, excluding child components. - **[component]** (MemoryTree) - Memory usage of a named child component. ``` -------------------------------- ### Configure Builtin Headers Source: https://clangd.llvm.org/config.html Control whether clangd uses its own built-in headers or system headers extracted from the query driver. Defaults to using clangd's built-in headers. ```yaml CompileFlags: BuiltinHeaders: QueryDriver ``` -------------------------------- ### textDocument/ast Source: https://clangd.llvm.org/extensions Requests the Abstract Syntax Tree (AST) for a specified region of a text document. This allows clients to inspect the syntactic and semantic structure of C++ code. ```APIDOC ## textDocument/ast ### Description Requests the Abstract Syntax Tree (AST) for a specified region of a text document. This allows clients to inspect the syntactic and semantic structure of C++ code. ### Method `textDocument/ast` ### Parameters #### Request Body - **textDocument** (TextDocumentIdentifier) - Required - The open file to inspect. - **range** (Range) - Required - The region of the source code whose AST is fetched. The highest-level node that entirely contains the range is returned. ### Response #### Success Response (200) - **role** (string) - The general kind of node, such as "expression". Corresponds to clang's base AST node type, such as Expr. - **kind** (string) - The specific kind of node, such as "BinaryOperator". Corresponds to clang's concrete node class, with Expr etc suffix dropped. - **detail** (string?) - Brief additional details, such as '||'. Information present here depends on the node kind. - **arcana** (string?) - One line dump of information, similar to that printed by `clang -Xclang -ast-dump`. Only available for certain types of nodes. - **range** (Range) - The part of the code that produced this node. Missing for implicit nodes, nodes produced by macro expansion, etc. - **children** (ASTNode[]?) - Descendants describing the internal structure. The tree of nodes is similar to that printed by `clang -Xclang -ast-dump`, or that traversed by `clang::RecursiveASTVisitor`. ``` -------------------------------- ### File status Source: https://clangd.llvm.org/extensions Provides information about activity on clangd's per-file worker thread, which can be relevant to users as building the AST blocks many other operations. ```APIDOC ## File status ### Description Provides information about activity on clangd's per-file worker thread. This can be relevant to users as building the AST blocks many other operations. ### Notification `textDocument/clangd.fileStatus` (Server -> Client Notification) ### Parameters #### Notification Parameters - **FileStatus** (object) - The current activity for a file changes. Replaces previous activity for that file. - **uri** (string) - The document whose status is being updated. - **state** (string) - Human-readable information about current activity. ### Initialization Option #### `initializationOptions.clangdFileStatus` - **Type**: `bool` - **Description**: Enables receiving `textDocument/clangd.fileStatus` notifications. ``` -------------------------------- ### Suppress Unused Include Warning Source: https://clangd.llvm.org/guides/include-cleaner Use this pragma to prevent a specific `#include` from being flagged as unused, without needing to justify its usage. ```c++ #include "secretly-used.h" // IWYU pragma: keep ``` -------------------------------- ### Configure Hover Card Contents Source: https://clangd.llvm.org/config.html Defines what information appears in hover cards, including whether to show 'aka' (also known as) for desugared types and the character limit for macro expansions. ```yaml Hover: ShowAKA: false MacroContentsLimit: 2048 ```