A language server for GN, and a tiny VSCode extension wrapping the server.
Find a file
2025-04-14 03:24:41 +00:00
.github/workflows build: Fix cargo release 2025-04-13 17:22:01 +09:00
docs/screenshots Update docs 2025-03-27 11:33:40 +09:00
scripts build: Don't publish pre-releases to crates.io 2025-04-12 09:14:22 +09:00
src chore: Improve error messages on GN binary not found 2025-04-08 23:25:46 +09:00
testdata/workspaces Add cycles test 2025-02-04 23:19:52 +09:00
vscode-gn Bump version to 1.5.3 2025-04-14 03:24:41 +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
build.rs Checkout gn in $OUT_DIR 2025-03-26 21:41:33 +09:00
Cargo.lock Bump version to 1.5.3 2025-04-14 03:24:41 +00:00
Cargo.toml Bump version to 1.5.3 2025-04-14 03:24:41 +00:00
CHANGELOG.md Release 1.4.0 2025-04-09 17:48:03 +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 docs: Mention Fuchsia in docs 2025-04-08 23:25:35 +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
  • Context-aware completion
  • Hover documentation
  • Go to definition
  • Following imports
  • Following dependencies
  • Sticky scroll with useful lines
  • Outline
  • Code folding
  • Formatting
  • Go to the nearest BUILD.gn (VSCode only)

Installing

VSCode

You can install from the official 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

Completion

Hover documentation

Hover documentation

Go to definition

Go to definition

Following imports

Following imports

Following dependencies

Following dependencies

Sticky scroll with useful lines

Sticky scroll with useful lines

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

Disclaimer

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