A language server for GN, and a tiny VSCode extension wrapping the server.
Find a file
google-labs-jules[bot] 396ccd18ae Bundle gn-language-server binary in IntelliJ plugin
This change updates the build process and runtime logic of the IntelliJ plugin to bundle and use a prebuilt gn-language-server binary.

- Modified `intellij-gn/build.gradle.kts` to accept a `gnBinaryPath` property and copy the specified binary into the plugin's `bin` directory during the `prepareSandbox` task.
- Updated `GnLspServerFactory.kt` to look for the `gn-language-server` executable within the plugin's installation directory. If found, it is used; otherwise, the plugin falls back to using the executable from the system PATH.
- Updated `.github/workflows/ci.yml` to build the IntelliJ plugin as part of the CI pipeline, passing the platform-specific rust binary path to the Gradle build, and uploading the resulting plugin artifacts.
2025-12-20 08:27:53 +00:00
.github/workflows Bundle gn-language-server binary in IntelliJ plugin 2025-12-20 08:27:53 +00:00
docs/screenshots Update README 2025-12-16 15:31:38 +09:00
intellij-gn Bundle gn-language-server binary in IntelliJ plugin 2025-12-20 08:27:53 +00:00
scripts Fix build errors in stale gn checkout 2025-12-15 21:10:38 +09:00
src Exclude symbols from BUILD.gn for completion 2025-12-17 23:46:50 +09:00
testdata/workspaces Add a smoke test for code lens 2025-12-17 00:37:40 +09:00
vscode-gn Bump version to 1.9.19 2025-12-20 03:31:28 +00:00
.clippy.toml Suppress false positives of clippy::mutable_key_type 2025-01-22 21:08:17 +09:00
.gitignore Checkout gn in $OUT_DIR 2025-03-26 21:41:33 +09:00
ARCHITECTURE.md Support parallel analysis (again) 2025-12-15 17:07:18 +09:00
build.rs Checkout gn in $OUT_DIR 2025-03-26 21:41:33 +09:00
Cargo.lock Bump version to 1.9.19 2025-12-20 03:31:28 +00:00
Cargo.toml Bump version to 1.9.19 2025-12-20 03:31:28 +00:00
CHANGELOG.md Update CHANGELOG 2025-12-16 16:09:11 +09:00
CONTRIBUTING.md Initial commit 2025-01-06 07:49:20 +09:00
deny.toml Check licenses with cargo-deny 2025-03-24 20:26:59 +09:00
LICENSE Initial commit 2025-01-06 07:49:20 +09:00
README.md Update README 2025-12-16 15:31:38 +09:00

GN Language Server

CI

A language server for GN, the build configuration language used in Chromium, Fuchsia, and other projects.

Features

  • Syntax highlighting
  • Syntax error reporting
  • Context-aware completion and auto-import
  • Hover documentation
  • Go to definition
  • Finding target references
  • Following imports
  • Following dependencies
  • Quick fix
  • Sticky scroll with useful lines
  • Code lens
  • Outline
  • Code folding
  • Formatting
  • Go to the nearest BUILD.gn (VSCode only)

Installing

VSCode

You can install from the official VSCode marketplace or the OpenVSX marketplace. Search for "GN Language" in the VSCode's extension window.

VSCode Marketplace

Other Editors/IDEs

You can install the language server with Cargo.

cargo install gn-language-server

Syntax highlighting

Syntax highlighting

Completion and auto-import

Completion and auto-import

Hover documentation

Hover documentation

Go to definition

Go to definition

Following imports

Following imports

Following dependencies

Following dependencies

Quick fix

Quick fix

Sticky scroll with useful lines

Sticky scroll with useful lines

Code lens

Code lens

Outline

Outline

Code folding

Code folding

Building from source

Language server binary

cargo build --release

VSCode extension

cd vscode-gn
npm install
npm run build
npm run package

Versioning scheme

We use the versioning scheme recommended by the VSCode's official documentation. That is:

  • Pre-release versions are 1.<odd>.x
  • Release versions are 1.<even>.x

Architecture

For an overview of the project's architecture, see ARCHITECTURE.md.

Disclaimer

This is not an officially supported Google product. This project is not eligible for the Google Open Source Software Vulnerability Rewards Program.