A VS Code extension that provides syntax highlighting and language support for DAN (Data Advanced Notation) files.
- Syntax Highlighting: Full syntax highlighting for DAN files
- Language Support: Recognizes
.danfile extension - Comment Support: Supports both
#and//style comments - Bracket Matching: Auto-closing brackets for
{},[], and() - Smart Indentation: Automatic indentation for blocks and tables
- Clone this repository
- Run
npm installto install dependencies - Run
npm run compileto compile TypeScript - Press
F5in VS Code to open a new window with the extension loaded - Or package the extension:
vsce package(requiresvscetool)
- Download the
.vsixfile - Open VS Code
- Go to Extensions view (
Ctrl+Shift+X) - Click the
...menu and select "Install from VSIX..." - Select the downloaded
.vsixfile
Simply open any .dan file in VS Code. The extension will automatically:
- Apply syntax highlighting
- Enable bracket matching
- Support comments with
#or// - Provide smart indentation
DAN supports:
- Blocks:
key { ... } - Key-Value Pairs:
key: value - Tables:
key: table(col1, col2, ...) [ ... ] - Arrays:
[value1, value2, ...] - Strings:
"quoted strings" - Numbers:
123,45.67 - Booleans:
true,false - Comments:
# commentor// comment
# Sample configuration
app {
name: "My App"
version: 1.0.0
server {
host: localhost
port: 3000
}
}
users: table(id, name, email) [
1, Alice, "alice@example.com"
2, Bob, "bob@example.com"
]
- Node.js (v14 or higher)
- npm
- VS Code
npm install
npm run compile- Open this folder in VS Code
- Press
F5to launch a new Extension Development Host window - Open a
.danfile to test syntax highlighting
Run the test suite:
npm run compile
npm testThis will:
- Compile TypeScript files
- Download VS Code (if needed)
- Run all test cases
- Verify extension activation, language registration, and syntax highlighting
Note: On Linux, tests require a display server. In CI/CD, Xvfb is automatically set up. For local Linux testing, you may need to run tests with a display server or use WSL with X11 forwarding.
The test suite includes:
- Extension activation and registration
- Language ID recognition
- Syntax highlighting for comments, strings, numbers, booleans
- Table and array syntax
- Nested block structures
- Example file parsing
MIT
See CONTRIBUTING.md, CODE_OF_CONDUCT.md, SECURITY.md, and use the issue / PR templates in .github/. Optional support: PayPal or the repository Sponsor button.
Pull requests should pass npm run compile and npm test where applicable.