Configuring the clangd engine
The C++ language engine in Fleet is powered by clangd.
clangd configuration files
To customize the behavior of the clangd engine, use clangd configuration files.
For shared project-level settings, use a .clangd file. It can include compiler flags for the entire project or specific files.
For user-level settings, use a config.yaml file located in one of the OS-specific directories.
Example: enabling CUDA support in .clangd
To enable full support for CUDA files, adjust the CompileFlags section in your .clangd file:
On Windows:
CompileFlags: Remove: - -forward-unknown-to-host-compiler - --generate-code* - -rdc=* - -Xcompiler* Add: - --cuda-path=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.0On Linux (tested on Ubuntu):
CompileFlags: Remove: - -forward-unknown-to-host-compiler - --generate-code* - -rdc=* - -Xcompiler*
Clangd settings
You can also configure Clangd by editing the settings.json file.
Configure Clangd settings
Press ⌘ , to open settings.
Alternatively, to open settings, you can use the main menu:
Windows and Linux: click the Menu icon and navigate to .
macOS: from the main menu, click
.
Click the tab with the name of your workspace.
Navigate to
.Click Edit in settings.json.
In the file, specify the following parameters as needed:
{ "lsp.clangd.compilation.databases": ["build/compile_commands.json"], "lsp.use.clangd.dynamic.index": true, "lsp.use.clangd.indexer": true }
Clangd indexer
The clangd-based indexer improves the performance and accuracy of search operations in your C++ projects.
Configure the clangd indexer
Press ⌘ , to open settings.
Alternatively, to open settings, you can use the main menu:
Windows and Linux: click the Menu icon and navigate to .
macOS: from the main menu, click
.
Click the tab with the name of your workspace.
In the left-hand pane, navigate to
.Use JetBrains clangd for indexing: enables the JetBrains-provided clangd indexer.
Use dynamic clangd index: improves search performance in recently opened files.