An extension for Visual Studio Code designed to configure Unreal Engine C++ projects (including UE 5.7 and 5.8) to work seamlessly with clangd IntelliSense.
Provides fast, accurate, and responsive code completion, navigation, and diagnostics for Unreal Engine C++ code, eliminating the common false-positive "red squiggles" and high CPU usage issues associated with the default Microsoft C++ IntelliSense engine.
Prerequisites
Before using this extension, please ensure your system meets the following requirements:
- Install clangd Toolchain:
- You need the
clangdlanguage server binary on your machine. - You can download the LLVM/clangd toolchain from LLVM Releases or let VS Code install it automatically.
- You need the
- Install VS Code Extensions:
- clangd VS Code Extension (Required: this runs the language server client).
- C/C++ Extension by Microsoft (Recommended: needed for launching/debugging your game targets, though we disable its IntelliSense engine to avoid conflicts).
- Compile the Project At Least Once:
- Unreal Engine relies heavily on reflection and code generation (creating
*.generated.hfiles). - You must compile your project at least once via Unreal Editor or VS Code build tasks before generating the clang database. If you don't compile,
clangdwill report errors about missing generated headers.
- Unreal Engine relies heavily on reflection and code generation (creating
Key Features
- Automated Clangd Setup: Automatically creates a custom project-specific
.clangdfile with optimized compiler arguments, disabled template parsing warnings, and specific diagnostic suppressions for Unreal Engine's macro systems (UCLASS,GENERATED_BODY, etc.). - Automatic Compile Commands Generation: Locates the
UnrealBuildToolexecutable (by scanning tasks, the registry, or standard installation paths) and runs it with-mode=GenerateClangDatabaseto buildcompile_commands.json. - Database Relocation: Automatically moves/copies the generated
compile_commands.jsondatabase from the Engine root folder to your project root where theclangdlanguage server can find it. - Conflict Prevention: Disables Microsoft C/C++ extension's IntelliSense workspace engine (
C_Cpp.intelliSenseEngine = disabled) to prevent duplicate diagnostics, lag, and resource conflicts. - One-Click UI Controls:
- Status Bar Button: Displays a
Generate Clang Databaseshortcut button at the bottom of the window. - Editor Title Button: Shows a database sync icon in the top-right toolbar when editing C++ or
.uprojectfiles for quick regeneration.
- Status Bar Button: Displays a
- Auto-Run on Startup: Prompts you to run the initial setup automatically if your project is missing a
.clangdfile orcompile_commands.jsonupon opening.
How to Use
- First-time Setup:
- Open your Unreal Engine C++ project directory in VS Code.
- If it's a fresh setup, you will see a notification prompting you to configure the project. Click Setup Now.
- Alternatively, open the Command Palette (
Ctrl+Shift+P) and selectUnreal Utils: Setup Project for Clangd.
- Updating the Database:
- Whenever you add new C++ files, rename modules, or add new plugin dependencies, the compiler paths change.
- Simply click the Generate Clang Database button on the bottom status bar, or click the Sync Database icon in the editor toolbar (top-right of C++ files) to regenerate and copy
compile_commands.json.
Troubleshooting
Issue: Missing *.generated.h files
- Cause: The project hasn't been built yet, or UBT generated the database without building files.
- Solution: Build your project inside Unreal Editor (e.g. click "Live Coding" or Compile) or run a standard build task in VS Code. Once built, restart the
clangdserver via the Command Palette (clangd: Restart language server).
Issue: Extension says "Could not locate UnrealBuildTool"
- Cause: Your project doesn't have generated VS Code workspace files, or the Engine is in a non-standard location not indexed by the registry.
- Solution:
- Open Unreal Editor and select Tools -> Generate Visual Studio Code Project.
- Open VS Code Settings (
Ctrl+,), search forUnreal Build Tool Path, and manually paste the absolute path to yourUnrealBuildTool.exe.
Issue: Duplicate Diagnostics or Slow Editing Performance
- Cause: Microsoft's C/C++ extension IntelliSense is still running.
- Solution: Ensure your workspace settings file (
.vscode/settings.json) contains"C_Cpp.intelliSenseEngine": "disabled". This extension attempts to set this automatically during initial setup.
Extension Settings
This extension contributes the following settings:
unreal-utils.unrealBuildToolPath: Custom path to theUnrealBuildToolexecutable. If empty, the extension will auto-resolve it from.vscode/tasks.jsonor registry entries.unreal-utils.targetName: Custom project target name (e.g.MyGameEditor). If left empty, it auto-detects based on the.Target.csfiles in yourSource/folder.unreal-utils.buildConfiguration: The build configuration to use when generating compile commands (defaults toDevelopment).unreal-utils.buildPlatform: The target platform (defaults toWin64).unreal-utils.autoRunOnStartup: Toggles whether the extension prompts you to run setup if configurations are missing on startup (default:true).unreal-utils.useNoExecCodeGenActions: Appends the-NoExecCodeGenActionsflag to the UBT command to significantly speed up database generation (default:true).
License
MIT License. Copyright (c) 2026 Siddartha Gonnabattula.