vscode-arx
Highlight-only VS Code extension for the Arx programming language.
Features
- TextMate syntax highlighting (
source.arx)
- Basic language configuration:
- line comments (
#)
- brackets (
(), {}, [])
- auto-closing and surrounding pairs
This extension intentionally has no language server, commands, or runtime extension code.
Source of Truth
Lexical rules are sourced from:
This file is vendored from the main Arx repository and used to generate:
syntaxes/arx.tmLanguage.json
Local Development
- Open this repo in VS Code.
- Run:
npm run build:grammar
- Press
F5 to launch an Extension Development Host.
- Open an
.arx file in the new window.
Keep It In Sync
From this repo:
npm run sync:syntax
npm run check:grammar
By default, sync:syntax clones:
https://github.com/arxlang/arx.git
- branch/ref
main
You can override source repo/ref:
ARX_REPO_URL=https://github.com/arxlang/arx.git \
ARX_REPO_REF=main \
npm run sync:syntax
Updating Keywords / Operators
- Update the canonical manifest in the main Arx repo.
- Run
npm run sync:syntax in this repo.
- Commit both:
syntax/arx.syntax.json
syntaxes/arx.tmLanguage.json
Build and Publish
Build a VSIX:
npm run build:vsix
Publish both Marketplace and Open VSX:
export VSCE_PAT="***"
export OVSX_PAT="***"
npm run publish:all
Marketplace only (bump patch):
export VSCE_PAT="***"
bash ./scripts/publish.sh --marketplace --bump patch --no-dependencies
CI (GitHub Actions)
This repo includes .github/workflows/main.yaml with:
- PR branch freshness check.
- Script syntax + grammar sync validation.
- Optional VSIX packaging and artifact upload.
The VSIX packaging step is skipped until package.json placeholders are replaced:
Pre-commit Hooks
This repo uses .pre-commit-config.yaml for local checks before commit.
Install once:
python3 -m pip install pre-commit
pre-commit install
Run manually on all files:
pre-commit run --all-files
Included hooks:
- JSON/YAML/basic whitespace checks.
npm run check:grammar when syntax/grammar generator files change.
bash -n syntax checks for shell scripts.
Notes and TODO Defaults
The upstream manifest currently marks some lexical areas as unspecified.
This extension uses conservative TODO defaults for highlighting only:
- TODO(ARX-VSCODE-STRINGS-001): provisional single/double-quoted string scopes.
- TODO(ARX-VSCODE-LITERALS-001): provisional
true|false|null literal scopes.
- TODO(ARX-VSCODE-OPS-001): provisional multi-char operators (
==, !=, <=, >=, ->).
When upstream syntax rules are finalized, these defaults should be replaced by manifest-driven values.
File Associations
This extension registers .arx by default.
TODO: .x is intentionally not auto-registered yet to avoid extension collisions.
If you want local .x association now, add this in your user/workspace settings:
{
"files.associations": {
"*.x": "arx"
}
}
Contributing
- Keep
syntax/arx.syntax.json as the single lexical source.
- Regenerate grammar (
npm run build:grammar).
- Run check (
npm run check:grammar).
- Open PR with generated files included.