Build GN/Ninja targets directly from VS Code. Find targets across generated build directories,
run builds and maintenance commands, and inspect compiler diagnostics without switching to a
separate terminal workflow.
Features
Discover GN build directories and browse or filter their targets.
Build and rebuild targets, clean targets or build directories, and build the default target.
Keep frequently used targets in Favorites and return to recently built targets.
Run gn gen, inspect target descriptions and references, and view dependency graphs.
See GCC/Clang, MSVC, and GN diagnostics in VS Code's Problems panel.
Review recorded build-step durations with Build Analysis.
Requirements
VS Code 1.75 or later.
GN and Ninja installed and available on PATH, or configured with the gnPath and ninjaPath settings.
A GN workspace containing .gn or BUILD.gn files.
Get Started
Open the root folder of your GN workspace in VS Code.
Select GN Ninja in the Activity Bar and choose a build directory, or run gn gen to create one.
Browse or filter targets, then build from a target's context menu or the Actions view.
The extension detects build directories by their args.gn files, including nested directories.
If your build uses non-standard executable locations, set gnNinja.gnPath and gnNinja.ninjaPath in Settings.
Keyboard Shortcuts
Shortcut
Action
Ctrl+Alt+B
Search for and build a target
Ctrl+Alt+Shift+B
Build the default target
Ctrl+Alt+G
Run gn gen for the active directory
Configuration
All settings use the gnNinja.* prefix. In particular, gnPath and ninjaPath select the executables, buildDir sets the preferred build directory, and defaultTarget selects the default build target. Additional settings control build arguments, parallel jobs, and build-on-save. The optional gnNinja.useTerminal setting moves builds to the integrated terminal and disables progress reporting and Problems panel diagnostics.