Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Egret-langNew to Visual Studio Code? Get it now.
Egret-lang

Egret-lang

egret-lang.org

|
1 install
| (0) | Free
Syntax highlighting and language configuration for Egret-lang (.eg) source files.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Egret-lang for Visual Studio Code

Official VS Code language extension for Egret-lang.

This extension provides syntax highlighting and editor language configuration for Egret-lang .eg source files.

Features

  • Syntax highlighting for .eg files.
  • Language registration under Egret-lang, Egret, egret-lang, and egret.
  • Comment support for // ... and /* ... */.
  • Folding markers for #if / #endif and @AI / @END blocks.
  • Bracket and quote auto-closing.
  • Default indentation style for Egret-lang files: 4 spaces.

The TextMate grammar covers the current stable Egret-lang syntax, including:

  • Declarations: module, use, const, type, enum, class, norm, norm impl, func, extern func, builtin func, and async func.
  • Class lifecycle methods: init, dispose, and deinit.
  • Control flow: if, else, loop, break, skip, return, match, defer, and dispose.
  • Async and lazy syntax: async, await, spawn, join, lazy, and force.
  • Object and type syntax: new, super, super<Base>, immut, optional types, Future(T), Future(T, ErrCode), Lazy(T), and Type { field: value } field initializer expressions.
  • Operators and literals: =>, =>?, ?, ..., 0b..., 0o..., 0x..., C strings c"...", and common escape sequences.

Installation From Marketplace

After publication, install it from VS Code:

  1. Open Extensions.
  2. Search for egret-lang or egret.
  3. Install Egret-lang by publisher egret-lang.

Local Development

Open this directory in VS Code:

cd tools/vs-egret-lang-ext
code .

Then press F5 to launch an Extension Development Host and open any .eg file.

Package Locally

Install vsce if needed:

npm install -g @vscode/vsce

Package the extension:

cd tools/vs-egret-lang-ext
vsce package

Install the generated .vsix locally:

code --install-extension egret-lang-0.1.0.vsix

Publish

Make sure the publisher in package.json exists in the Visual Studio Marketplace and that you have a valid Personal Access Token configured.

cd tools/vs-egret-lang-ext
vsce publish

The extension is discoverable through the displayName, description, aliases, and keywords fields in package.json, including egret-lang, egret, and egret language.

Source of Grammar

The syntax grammar is based on the repository's Egret-lang grammar and the existing local syntax package under:

tools/vs-syntax-highlight/

When the language syntax changes, update that source package first when appropriate, then sync the grammar and language configuration into this publishable extension.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft