All chapters25
On this page

HHY Tooling

Editor Language Support

Install HHY language packages for VS Code and Sublime Text, generated from one syntax source.

HHY Language Support 0.1.0

The editor packages recognize .hhy files and provide HHY syntax highlighting for # comments, shebangs, strings and escapes, Regex, numbers and units, keywords, and operators, plus bracket auto-closing, indentation, and common snippets. VS Code uses a TextMate grammar; Sublime Text uses .sublime-syntax.

Open the editor language-support source ↗Includes the shared syntax source, generator, VS Code and Sublime Text packages, and real .hhy regression fixtures.

Generate and verify the packages

sh
git clone https://github.com/hh696-wq/hhy-vm.git
cd hhy-vm/editors
npm install
npm run generate
npm run check
npm run package

The package command creates dist/hhy-language-support-0.1.0.vsix and dist/HHY-0.1.0.sublime-package. The check command compares Lexer keywords and literal suffixes, validates plugin metadata and generated-file freshness, and checks every fixture with the real HHY binary.

Install in VS Code

sh
code --install-extension editors/dist/hhy-language-support-0.1.0.vsix

You can also open Extensions in VS Code and choose Install from VSIX from the top-right menu. After installation, any .hhy file is automatically recognized as HHY.

Install in Sublime Text

Copy editors/dist/HHY-0.1.0.sublime-package into Sublime Text's Installed Packages directory. For development, copy editors/sublime into Packages/HHY. Opening a .hhy file then enables HHY syntax automatically.