Files
carbon-lang/utils/vscode
Chandler Carruth 437be71f1f Overhaul the TextMate grammar (#7746)
Four regions had `end` patterns that could fail to match, so `return
var;`, a `fn` with no parameter list, and an unterminated `"` each
swallowed the rest of the file; 77 of 1696 testdata files lost their
highlighting partway through. Operators were wrapped in `\b`, which only
holds next to a word character, so `a + b` highlighted nothing. And the
keywords had drifted about two years behind the lexer.

Identifiers are now classified by naming convention plus a call-site
lookahead, the way the Rust grammar does it, so nothing carries between
lines. Regions survive only for strings and embedded C++, where a
terminator reliably turns up, and raw strings spell out hash levels 0
through 2, so `\n` is an escape in `"..."` and plain text in `#"..."#`.
Trailing comments, character literals, raw identifiers, `$0`, `0o`
octal, arbitrary integer widths and six missing keywords are covered
now, `destructor` is gone, and `i32` reads as a type rather than as a
keyword.

Highlighting stays forgiving rather than diagnostic: anything after `//`
is a comment and odd numeric spellings still read as numbers. Pointing
out mistakes is the toolchain's job, and lenient rules hold steady while
you are still typing.

Every keyword and symbol in `token_kind.def` is covered, and unscoped
tokens across examples and the toolchain drop from 39% to 21%.

Note that I haven't tried to read and reason about every minute change
here as there are just too many. But I'm working on a follow-up PR that
adds testing that should be significantly easier te review.

Assisted-by: Claude Code
2026-09-15 22:03:22 +00:00
..

Carbon Language

This extension provides support for the Carbon Language.

This extension is currently experimental, and being developed alongside Carbon.

Quickstart

  1. Download and install a carbon release.
    • By default, the extension will look for carbon under ./bazel-bin. This is for developers actively working on Carbon and running VS Code inside a carbon-lang clone.
  2. Install the Carbon Language extension.
  3. Configure the installed path to carbon.

Configuration

The configuration is under carbon.*. At present, the only configuration is the path to the carbon binary. This looks like:

"carbon.carbonPath": "/path/to/carbon"

Communication

See Carbon's collaboration systems. We're most active on Discord and have a #editor-integrations channel. We'll also respond to questions on GitHub Discussions.

Documentation

Carbon currently only has project-level documentation. See the GitHub repository.