zenith-language 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscodeignore +9 -0
- package/LICENSE +21 -0
- package/README.md +85 -0
- package/assets/logo.png +0 -0
- package/bun.lock +91 -0
- package/icons/zen.icns +0 -0
- package/icons/zenith-icon-theme.json +14 -0
- package/language-configuration.json +121 -0
- package/package.json +102 -0
- package/scripts/build.js +120 -0
- package/src/extension.ts +51 -0
- package/syntaxes/zenith.tmLanguage.json +465 -0
- package/test/fixtures/grammar-test.zen +36 -0
- package/tsconfig.json +26 -0
- package/zenith-language/.gitattributes +2 -0
package/.vscodeignore
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Zenith Build
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Zenith VS Code Extension
|
|
2
|
+
|
|
3
|
+
Syntax highlighting and editor support for `.zen` files.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Syntax Highlighting** for `.zen` files
|
|
8
|
+
- **HTML-first** structure recognition
|
|
9
|
+
- **Embedded JavaScript** in `<script>` blocks with Zenith-specific keywords (`state`, `zenOnMount`, etc.)
|
|
10
|
+
- **Embedded CSS** in `<style>` blocks
|
|
11
|
+
- **Expression highlighting** for `{expression}` syntax in HTML
|
|
12
|
+
- **Component recognition** for capitalized tags (e.g., `<DefaultLayout>`)
|
|
13
|
+
- **Slot support** for `<slot />` elements
|
|
14
|
+
- **Bracket matching** and auto-closing
|
|
15
|
+
|
|
16
|
+
## Zenith-Specific Scopes
|
|
17
|
+
|
|
18
|
+
| Syntax | Scope |
|
|
19
|
+
|--------|-------|
|
|
20
|
+
| `state count = 0` | `storage.type.state.zen` |
|
|
21
|
+
| `zenOnMount(() => {})` | `support.function.lifecycle.zen` |
|
|
22
|
+
| `<DefaultLayout>` | `entity.name.tag.component.zen` |
|
|
23
|
+
| `<slot />` | `keyword.control.slot.zen` |
|
|
24
|
+
| `{expression}` | `meta.embedded.expression.zen` |
|
|
25
|
+
|
|
26
|
+
## Installation (Development)
|
|
27
|
+
|
|
28
|
+
1. Copy this folder to your VS Code extensions directory:
|
|
29
|
+
- **macOS**: `~/.vscode/extensions/zenith-lang`
|
|
30
|
+
- **Windows**: `%USERPROFILE%\.vscode\extensions\zenith-lang`
|
|
31
|
+
- **Linux**: `~/.vscode/extensions/zenith-lang`
|
|
32
|
+
|
|
33
|
+
2. Restart VS Code
|
|
34
|
+
|
|
35
|
+
3. Open any `.zen` file
|
|
36
|
+
|
|
37
|
+
## File Structure
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
zenith-vscode/
|
|
41
|
+
├── package.json # Extension manifest
|
|
42
|
+
├── language-configuration.json # Brackets, comments, folding
|
|
43
|
+
├── syntaxes/
|
|
44
|
+
│ └── zenith.tmLanguage.json # TextMate grammar
|
|
45
|
+
└── README.md
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Grammar Design Notes
|
|
49
|
+
|
|
50
|
+
### HTML Base
|
|
51
|
+
The grammar treats `.zen` files as HTML-first documents. Standard HTML tags are recognized and highlighted with `entity.name.tag.html.zen` scope.
|
|
52
|
+
|
|
53
|
+
### Embedded Languages
|
|
54
|
+
- `<script>` blocks use JavaScript/TypeScript highlighting with additional Zenith keyword recognition
|
|
55
|
+
- `<style>` blocks use standard CSS highlighting
|
|
56
|
+
|
|
57
|
+
### Expression Syntax
|
|
58
|
+
Single brace expressions `{...}` are recognized in HTML content and attributes. The content is highlighted as JavaScript. **Double braces `{{}}` are NOT supported** per Zenith syntax rules.
|
|
59
|
+
|
|
60
|
+
### Component Tags
|
|
61
|
+
Capitalized tags like `<DefaultLayout>` are recognized as Zenith components and receive `entity.name.tag.component.zen` scope for distinct styling.
|
|
62
|
+
|
|
63
|
+
### Zenith Keywords
|
|
64
|
+
The following Zenith-specific keywords are recognized in script blocks:
|
|
65
|
+
- `state` - reactive state declaration
|
|
66
|
+
- `zenOnMount` - lifecycle hook
|
|
67
|
+
- `zenOnDestroy` - lifecycle hook
|
|
68
|
+
- `zenOnUpdate` - lifecycle hook
|
|
69
|
+
- `zenEffect` - effect declaration
|
|
70
|
+
|
|
71
|
+
## REDCMD Compatibility
|
|
72
|
+
|
|
73
|
+
This grammar is authored following TextMate/REDCMD patterns:
|
|
74
|
+
- Uses standard `begin`/`end` capture groups
|
|
75
|
+
- Defines reusable patterns in `repository`
|
|
76
|
+
- Uses hierarchical scope names
|
|
77
|
+
- Compatible with VS Code's grammar engine
|
|
78
|
+
|
|
79
|
+
## Future Work
|
|
80
|
+
|
|
81
|
+
- [ ] IntelliSense / LSP support
|
|
82
|
+
- [ ] Snippets for common patterns
|
|
83
|
+
- [ ] Go-to-definition for components
|
|
84
|
+
- [ ] Hover documentation
|
|
85
|
+
# zenith-language
|
package/assets/logo.png
ADDED
|
Binary file
|
package/bun.lock
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
{
|
|
2
|
+
"lockfileVersion": 1,
|
|
3
|
+
"configVersion": 1,
|
|
4
|
+
"workspaces": {
|
|
5
|
+
"": {
|
|
6
|
+
"name": "zenith-language",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"vscode-languageclient": "^9.0.1",
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@types/node": "^20.0.0",
|
|
12
|
+
"@types/vscode": "^1.80.0",
|
|
13
|
+
"esbuild": "^0.19.0",
|
|
14
|
+
"typescript": "^5.0.0",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
"packages": {
|
|
19
|
+
"@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.19.12", "", { "os": "aix", "cpu": "ppc64" }, "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA=="],
|
|
20
|
+
|
|
21
|
+
"@esbuild/android-arm": ["@esbuild/android-arm@0.19.12", "", { "os": "android", "cpu": "arm" }, "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w=="],
|
|
22
|
+
|
|
23
|
+
"@esbuild/android-arm64": ["@esbuild/android-arm64@0.19.12", "", { "os": "android", "cpu": "arm64" }, "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA=="],
|
|
24
|
+
|
|
25
|
+
"@esbuild/android-x64": ["@esbuild/android-x64@0.19.12", "", { "os": "android", "cpu": "x64" }, "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew=="],
|
|
26
|
+
|
|
27
|
+
"@esbuild/darwin-arm64": ["@esbuild/darwin-arm64@0.19.12", "", { "os": "darwin", "cpu": "arm64" }, "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g=="],
|
|
28
|
+
|
|
29
|
+
"@esbuild/darwin-x64": ["@esbuild/darwin-x64@0.19.12", "", { "os": "darwin", "cpu": "x64" }, "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A=="],
|
|
30
|
+
|
|
31
|
+
"@esbuild/freebsd-arm64": ["@esbuild/freebsd-arm64@0.19.12", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA=="],
|
|
32
|
+
|
|
33
|
+
"@esbuild/freebsd-x64": ["@esbuild/freebsd-x64@0.19.12", "", { "os": "freebsd", "cpu": "x64" }, "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg=="],
|
|
34
|
+
|
|
35
|
+
"@esbuild/linux-arm": ["@esbuild/linux-arm@0.19.12", "", { "os": "linux", "cpu": "arm" }, "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w=="],
|
|
36
|
+
|
|
37
|
+
"@esbuild/linux-arm64": ["@esbuild/linux-arm64@0.19.12", "", { "os": "linux", "cpu": "arm64" }, "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA=="],
|
|
38
|
+
|
|
39
|
+
"@esbuild/linux-ia32": ["@esbuild/linux-ia32@0.19.12", "", { "os": "linux", "cpu": "ia32" }, "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA=="],
|
|
40
|
+
|
|
41
|
+
"@esbuild/linux-loong64": ["@esbuild/linux-loong64@0.19.12", "", { "os": "linux", "cpu": "none" }, "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA=="],
|
|
42
|
+
|
|
43
|
+
"@esbuild/linux-mips64el": ["@esbuild/linux-mips64el@0.19.12", "", { "os": "linux", "cpu": "none" }, "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w=="],
|
|
44
|
+
|
|
45
|
+
"@esbuild/linux-ppc64": ["@esbuild/linux-ppc64@0.19.12", "", { "os": "linux", "cpu": "ppc64" }, "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg=="],
|
|
46
|
+
|
|
47
|
+
"@esbuild/linux-riscv64": ["@esbuild/linux-riscv64@0.19.12", "", { "os": "linux", "cpu": "none" }, "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg=="],
|
|
48
|
+
|
|
49
|
+
"@esbuild/linux-s390x": ["@esbuild/linux-s390x@0.19.12", "", { "os": "linux", "cpu": "s390x" }, "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg=="],
|
|
50
|
+
|
|
51
|
+
"@esbuild/linux-x64": ["@esbuild/linux-x64@0.19.12", "", { "os": "linux", "cpu": "x64" }, "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg=="],
|
|
52
|
+
|
|
53
|
+
"@esbuild/netbsd-x64": ["@esbuild/netbsd-x64@0.19.12", "", { "os": "none", "cpu": "x64" }, "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA=="],
|
|
54
|
+
|
|
55
|
+
"@esbuild/openbsd-x64": ["@esbuild/openbsd-x64@0.19.12", "", { "os": "openbsd", "cpu": "x64" }, "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw=="],
|
|
56
|
+
|
|
57
|
+
"@esbuild/sunos-x64": ["@esbuild/sunos-x64@0.19.12", "", { "os": "sunos", "cpu": "x64" }, "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA=="],
|
|
58
|
+
|
|
59
|
+
"@esbuild/win32-arm64": ["@esbuild/win32-arm64@0.19.12", "", { "os": "win32", "cpu": "arm64" }, "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A=="],
|
|
60
|
+
|
|
61
|
+
"@esbuild/win32-ia32": ["@esbuild/win32-ia32@0.19.12", "", { "os": "win32", "cpu": "ia32" }, "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ=="],
|
|
62
|
+
|
|
63
|
+
"@esbuild/win32-x64": ["@esbuild/win32-x64@0.19.12", "", { "os": "win32", "cpu": "x64" }, "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA=="],
|
|
64
|
+
|
|
65
|
+
"@types/node": ["@types/node@20.19.27", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-N2clP5pJhB2YnZJ3PIHFk5RkygRX5WO/5f0WC08tp0wd+sv0rsJk3MqWn3CbNmT2J505a5336jaQj4ph1AdMug=="],
|
|
66
|
+
|
|
67
|
+
"@types/vscode": ["@types/vscode@1.107.0", "", {}, "sha512-XS8YE1jlyTIowP64+HoN30OlC1H9xqSlq1eoLZUgFEC8oUTO6euYZxti1xRiLSfZocs4qytTzR6xCBYtioQTCg=="],
|
|
68
|
+
|
|
69
|
+
"balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="],
|
|
70
|
+
|
|
71
|
+
"brace-expansion": ["brace-expansion@2.0.2", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ=="],
|
|
72
|
+
|
|
73
|
+
"esbuild": ["esbuild@0.19.12", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.19.12", "@esbuild/android-arm": "0.19.12", "@esbuild/android-arm64": "0.19.12", "@esbuild/android-x64": "0.19.12", "@esbuild/darwin-arm64": "0.19.12", "@esbuild/darwin-x64": "0.19.12", "@esbuild/freebsd-arm64": "0.19.12", "@esbuild/freebsd-x64": "0.19.12", "@esbuild/linux-arm": "0.19.12", "@esbuild/linux-arm64": "0.19.12", "@esbuild/linux-ia32": "0.19.12", "@esbuild/linux-loong64": "0.19.12", "@esbuild/linux-mips64el": "0.19.12", "@esbuild/linux-ppc64": "0.19.12", "@esbuild/linux-riscv64": "0.19.12", "@esbuild/linux-s390x": "0.19.12", "@esbuild/linux-x64": "0.19.12", "@esbuild/netbsd-x64": "0.19.12", "@esbuild/openbsd-x64": "0.19.12", "@esbuild/sunos-x64": "0.19.12", "@esbuild/win32-arm64": "0.19.12", "@esbuild/win32-ia32": "0.19.12", "@esbuild/win32-x64": "0.19.12" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg=="],
|
|
74
|
+
|
|
75
|
+
"minimatch": ["minimatch@5.1.6", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g=="],
|
|
76
|
+
|
|
77
|
+
"semver": ["semver@7.7.3", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q=="],
|
|
78
|
+
|
|
79
|
+
"typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],
|
|
80
|
+
|
|
81
|
+
"undici-types": ["undici-types@6.21.0", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="],
|
|
82
|
+
|
|
83
|
+
"vscode-jsonrpc": ["vscode-jsonrpc@8.2.0", "", {}, "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA=="],
|
|
84
|
+
|
|
85
|
+
"vscode-languageclient": ["vscode-languageclient@9.0.1", "", { "dependencies": { "minimatch": "^5.1.0", "semver": "^7.3.7", "vscode-languageserver-protocol": "3.17.5" } }, "sha512-JZiimVdvimEuHh5olxhxkht09m3JzUGwggb5eRUkzzJhZ2KjCN0nh55VfiED9oez9DyF8/fz1g1iBV3h+0Z2EA=="],
|
|
86
|
+
|
|
87
|
+
"vscode-languageserver-protocol": ["vscode-languageserver-protocol@3.17.5", "", { "dependencies": { "vscode-jsonrpc": "8.2.0", "vscode-languageserver-types": "3.17.5" } }, "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg=="],
|
|
88
|
+
|
|
89
|
+
"vscode-languageserver-types": ["vscode-languageserver-types@3.17.5", "", {}, "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg=="],
|
|
90
|
+
}
|
|
91
|
+
}
|
package/icons/zen.icns
ADDED
|
Binary file
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
{
|
|
2
|
+
"comments": {
|
|
3
|
+
"lineComment": "//",
|
|
4
|
+
"blockComment": [
|
|
5
|
+
"/*",
|
|
6
|
+
"*/"
|
|
7
|
+
]
|
|
8
|
+
},
|
|
9
|
+
"brackets": [
|
|
10
|
+
[
|
|
11
|
+
"{",
|
|
12
|
+
"}"
|
|
13
|
+
],
|
|
14
|
+
[
|
|
15
|
+
"[",
|
|
16
|
+
"]"
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
"(",
|
|
20
|
+
")"
|
|
21
|
+
],
|
|
22
|
+
[
|
|
23
|
+
"<",
|
|
24
|
+
">"
|
|
25
|
+
]
|
|
26
|
+
],
|
|
27
|
+
"autoClosingPairs": [
|
|
28
|
+
{
|
|
29
|
+
"open": "{",
|
|
30
|
+
"close": "}"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"open": "[",
|
|
34
|
+
"close": "]"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"open": "(",
|
|
38
|
+
"close": ")"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"open": "<",
|
|
42
|
+
"close": ">",
|
|
43
|
+
"notIn": [
|
|
44
|
+
"string",
|
|
45
|
+
"comment"
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"open": "\"",
|
|
50
|
+
"close": "\"",
|
|
51
|
+
"notIn": [
|
|
52
|
+
"string"
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"open": "'",
|
|
57
|
+
"close": "'",
|
|
58
|
+
"notIn": [
|
|
59
|
+
"string",
|
|
60
|
+
"comment"
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"open": "`",
|
|
65
|
+
"close": "`",
|
|
66
|
+
"notIn": [
|
|
67
|
+
"string",
|
|
68
|
+
"comment"
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"open": "<!--",
|
|
73
|
+
"close": "-->",
|
|
74
|
+
"notIn": [
|
|
75
|
+
"comment",
|
|
76
|
+
"string"
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"surroundingPairs": [
|
|
81
|
+
{
|
|
82
|
+
"open": "{",
|
|
83
|
+
"close": "}"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"open": "[",
|
|
87
|
+
"close": "]"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"open": "(",
|
|
91
|
+
"close": ")"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"open": "<",
|
|
95
|
+
"close": ">"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"open": "\"",
|
|
99
|
+
"close": "\""
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"open": "'",
|
|
103
|
+
"close": "'"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"open": "`",
|
|
107
|
+
"close": "`"
|
|
108
|
+
}
|
|
109
|
+
],
|
|
110
|
+
"folding": {
|
|
111
|
+
"markers": {
|
|
112
|
+
"start": "^\\s*<!--\\s*#region\\b.*-->",
|
|
113
|
+
"end": "^\\s*<!--\\s*#endregion\\b.*-->"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"indentationRules": {
|
|
117
|
+
"increaseIndentPattern": "<(?!\\?|(?:area|base|br|col|frame|hr|html|img|input|keygen|link|menuitem|meta|param|source|track|wbr|script|style)\\b|[^>]*/>)([-_\\.A-Za-z0-9]+)(?=\\s|>)\\b[^>]*>(?!.*</\\1>)|<!--(?!.*-->)|\\{[^}\"']*$",
|
|
118
|
+
"decreaseIndentPattern": "^\\s*(</[-_\\.A-Za-z0-9]+\\b[^>]*>|-?-->|\\})"
|
|
119
|
+
},
|
|
120
|
+
"wordPattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)"
|
|
121
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "zenith-language",
|
|
3
|
+
"displayName": "Zenith Language Support",
|
|
4
|
+
"description": "Syntax highlighting, IntelliSense, and editor support for Zenith Framework (.zen files)",
|
|
5
|
+
"version": "0.2.8",
|
|
6
|
+
"publisher": "ZenithBuild",
|
|
7
|
+
"engines": {
|
|
8
|
+
"vscode": "^1.80.0"
|
|
9
|
+
},
|
|
10
|
+
"main": "./out/extension.js",
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build:server": "cd ../packages/zenith-language-server && bun run build",
|
|
13
|
+
"compile": "esbuild src/extension.ts --bundle --outfile=out/extension.js --external:vscode --format=cjs --platform=node && cp ../packages/zenith-language-server/dist/server.js out/server.js",
|
|
14
|
+
"watch": "bun run compile -- --watch",
|
|
15
|
+
"build:marketplace": "bun run build:server && bun run compile && node scripts/build.js marketplace",
|
|
16
|
+
"build:openvsx": "bun run build:server && bun run compile && node scripts/build.js openvsx",
|
|
17
|
+
"build:all": "bun run build:server && bun run compile && node scripts/build.js all"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@types/node": "^20.0.0",
|
|
21
|
+
"@types/vscode": "^1.80.0",
|
|
22
|
+
"esbuild": "^0.19.0",
|
|
23
|
+
"typescript": "^5.0.0"
|
|
24
|
+
},
|
|
25
|
+
"categories": [
|
|
26
|
+
"Programming Languages"
|
|
27
|
+
],
|
|
28
|
+
"icon": "assets/logo.png",
|
|
29
|
+
"keywords": [
|
|
30
|
+
"zenith",
|
|
31
|
+
"zen",
|
|
32
|
+
"syntax",
|
|
33
|
+
"highlighting",
|
|
34
|
+
"intellisense",
|
|
35
|
+
"framework"
|
|
36
|
+
],
|
|
37
|
+
"contributes": {
|
|
38
|
+
"languages": [
|
|
39
|
+
{
|
|
40
|
+
"id": "zenith",
|
|
41
|
+
"aliases": [
|
|
42
|
+
"Zenith",
|
|
43
|
+
"zenith"
|
|
44
|
+
],
|
|
45
|
+
"extensions": [
|
|
46
|
+
".zen",
|
|
47
|
+
".zen.html",
|
|
48
|
+
".zenx"
|
|
49
|
+
],
|
|
50
|
+
"configuration": "./language-configuration.json"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"grammars": [
|
|
54
|
+
{
|
|
55
|
+
"language": "zenith",
|
|
56
|
+
"scopeName": "text.html.zenith",
|
|
57
|
+
"path": "./syntaxes/zenith.tmLanguage.json",
|
|
58
|
+
"embeddedLanguages": {
|
|
59
|
+
"source.js": "javascript",
|
|
60
|
+
"source.ts": "typescript",
|
|
61
|
+
"source.css": "css",
|
|
62
|
+
"text.html.basic": "html",
|
|
63
|
+
"meta.embedded.block.javascript": "javascript",
|
|
64
|
+
"meta.embedded.block.typescript": "typescript",
|
|
65
|
+
"meta.embedded.block.css": "css"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"configurationDefaults": {
|
|
70
|
+
"[zenith]": {
|
|
71
|
+
"editor.formatOnSave": true,
|
|
72
|
+
"editor.wordBasedSuggestions": "off",
|
|
73
|
+
"editor.suggest.insertMode": "replace",
|
|
74
|
+
"editor.semanticHighlighting.enabled": true,
|
|
75
|
+
"editor.quickSuggestions": {
|
|
76
|
+
"other": true,
|
|
77
|
+
"comments": false,
|
|
78
|
+
"strings": true
|
|
79
|
+
},
|
|
80
|
+
"editor.autoClosingBrackets": "always"
|
|
81
|
+
},
|
|
82
|
+
"emmet.includeLanguages": {
|
|
83
|
+
"zenith": "html"
|
|
84
|
+
},
|
|
85
|
+
"emmet.syntaxProfiles": {
|
|
86
|
+
"zenith": "html"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"repository": {
|
|
91
|
+
"type": "git",
|
|
92
|
+
"url": "https://github.com/zenithbuild/zenith"
|
|
93
|
+
},
|
|
94
|
+
"homepage": "https://github.com/zenithbuild/zenith#readme",
|
|
95
|
+
"bugs": {
|
|
96
|
+
"url": "https://github.com/zenithbuild/zenith/issues"
|
|
97
|
+
},
|
|
98
|
+
"license": "MIT",
|
|
99
|
+
"dependencies": {
|
|
100
|
+
"vscode-languageclient": "^9.0.1"
|
|
101
|
+
}
|
|
102
|
+
}
|
package/scripts/build.js
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Build script for Zenith VSCode Extension
|
|
5
|
+
* Supports dual publishing to VSCode Marketplace and Open VSX
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* node scripts/build.js marketplace - Build for VSCode Marketplace (ZenithBuild)
|
|
9
|
+
* node scripts/build.js openvsx - Build for Open VSX (zenithbuild)
|
|
10
|
+
* node scripts/build.js all - Build both
|
|
11
|
+
* node scripts/build.js - Defaults to marketplace
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const fs = require('fs');
|
|
15
|
+
const path = require('path');
|
|
16
|
+
const { execSync } = require('child_process');
|
|
17
|
+
|
|
18
|
+
const TARGETS = {
|
|
19
|
+
marketplace: {
|
|
20
|
+
publisher: 'ZenithBuild',
|
|
21
|
+
outputSuffix: 'vscode-marketplace'
|
|
22
|
+
},
|
|
23
|
+
openvsx: {
|
|
24
|
+
publisher: 'zenithbuild',
|
|
25
|
+
outputSuffix: 'openvsx'
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const packageJsonPath = path.join(__dirname, '..', 'package.json');
|
|
30
|
+
const rootDir = path.join(__dirname, '..');
|
|
31
|
+
|
|
32
|
+
function build(target) {
|
|
33
|
+
const config = TARGETS[target];
|
|
34
|
+
if (!config) {
|
|
35
|
+
console.error(`Unknown target: ${target}`);
|
|
36
|
+
console.error('Valid targets: marketplace, openvsx, all');
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
console.log(`\n🔧 Building for ${target}`);
|
|
41
|
+
console.log(` Publisher: ${config.publisher}\n`);
|
|
42
|
+
|
|
43
|
+
// Read package.json
|
|
44
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
45
|
+
const originalPublisher = packageJson.publisher;
|
|
46
|
+
const version = packageJson.version;
|
|
47
|
+
const name = packageJson.name;
|
|
48
|
+
|
|
49
|
+
// Output filename
|
|
50
|
+
const outputName = `${name}-${config.outputSuffix}.vsix`;
|
|
51
|
+
const defaultOutput = `${name}-${version}.vsix`;
|
|
52
|
+
|
|
53
|
+
// Update publisher
|
|
54
|
+
packageJson.publisher = config.publisher;
|
|
55
|
+
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 4) + '\n');
|
|
56
|
+
|
|
57
|
+
try {
|
|
58
|
+
// Run vsce package
|
|
59
|
+
console.log('📦 Packaging extension...\n');
|
|
60
|
+
execSync('vsce package', {
|
|
61
|
+
cwd: rootDir,
|
|
62
|
+
stdio: 'inherit'
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// Rename to target-specific name
|
|
66
|
+
const defaultPath = path.join(rootDir, defaultOutput);
|
|
67
|
+
const outputPath = path.join(rootDir, outputName);
|
|
68
|
+
|
|
69
|
+
if (fs.existsSync(defaultPath)) {
|
|
70
|
+
// Remove existing output if present
|
|
71
|
+
if (fs.existsSync(outputPath)) {
|
|
72
|
+
fs.unlinkSync(outputPath);
|
|
73
|
+
}
|
|
74
|
+
fs.renameSync(defaultPath, outputPath);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
console.log(`\n✅ Built: ${outputName}`);
|
|
78
|
+
console.log(` Publisher: ${config.publisher}`);
|
|
79
|
+
console.log(` Version: ${version}`);
|
|
80
|
+
|
|
81
|
+
if (target === 'marketplace') {
|
|
82
|
+
console.log('\n📤 To publish to VSCode Marketplace:');
|
|
83
|
+
console.log(' vsce publish');
|
|
84
|
+
} else {
|
|
85
|
+
console.log('\n📤 To publish to Open VSX:');
|
|
86
|
+
console.log(` npx ovsx publish ${outputName} -p <TOKEN>`);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return outputName;
|
|
90
|
+
|
|
91
|
+
} finally {
|
|
92
|
+
// Restore original publisher
|
|
93
|
+
packageJson.publisher = originalPublisher;
|
|
94
|
+
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 4) + '\n');
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function buildAll() {
|
|
99
|
+
console.log('🚀 Building for all targets...\n');
|
|
100
|
+
const outputs = [];
|
|
101
|
+
|
|
102
|
+
for (const target of Object.keys(TARGETS)) {
|
|
103
|
+
outputs.push(build(target));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
console.log('\n' + '='.repeat(50));
|
|
107
|
+
console.log('📦 All builds complete!\n');
|
|
108
|
+
console.log('Generated files:');
|
|
109
|
+
outputs.forEach(output => console.log(` • ${output}`));
|
|
110
|
+
console.log('');
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Get target from command line
|
|
114
|
+
const target = process.argv[2] || 'marketplace';
|
|
115
|
+
|
|
116
|
+
if (target === 'all') {
|
|
117
|
+
buildAll();
|
|
118
|
+
} else {
|
|
119
|
+
build(target);
|
|
120
|
+
}
|
package/src/extension.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as path from 'path';
|
|
2
|
+
import * as vscode from 'vscode';
|
|
3
|
+
import {
|
|
4
|
+
LanguageClient,
|
|
5
|
+
LanguageClientOptions,
|
|
6
|
+
ServerOptions,
|
|
7
|
+
TransportKind
|
|
8
|
+
} from 'vscode-languageclient/node';
|
|
9
|
+
|
|
10
|
+
let client: LanguageClient;
|
|
11
|
+
|
|
12
|
+
export function activate(context: vscode.ExtensionContext) {
|
|
13
|
+
// Server is bundled in out/server.js
|
|
14
|
+
const serverModule = context.asAbsolutePath(path.join('out', 'server.js'));
|
|
15
|
+
|
|
16
|
+
console.log('Zenith: Starting language server from:', serverModule);
|
|
17
|
+
|
|
18
|
+
const serverOptions: ServerOptions = {
|
|
19
|
+
run: { module: serverModule, transport: TransportKind.ipc },
|
|
20
|
+
debug: { module: serverModule, transport: TransportKind.ipc }
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const clientOptions: LanguageClientOptions = {
|
|
24
|
+
documentSelector: [{ scheme: 'file', language: 'zenith' }],
|
|
25
|
+
synchronize: {
|
|
26
|
+
fileEvents: vscode.workspace.createFileSystemWatcher('**/*.{zen,zen.html,zenx}')
|
|
27
|
+
},
|
|
28
|
+
// Disable pull diagnostics - server uses push diagnostics only
|
|
29
|
+
middleware: {
|
|
30
|
+
provideDiagnostics: () => undefined
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
client = new LanguageClient(
|
|
35
|
+
'zenithLanguageServer',
|
|
36
|
+
'Zenith Language Server',
|
|
37
|
+
serverOptions,
|
|
38
|
+
clientOptions
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
client.start();
|
|
42
|
+
|
|
43
|
+
console.log('Zenith Language Support activated');
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function deactivate(): Thenable<void> | undefined {
|
|
47
|
+
if (!client) {
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
return client.stop();
|
|
51
|
+
}
|
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
|
|
3
|
+
"name": "Zenith",
|
|
4
|
+
"scopeName": "text.html.zenith",
|
|
5
|
+
"fileTypes": [
|
|
6
|
+
"zen",
|
|
7
|
+
"zen.html",
|
|
8
|
+
"zenx"
|
|
9
|
+
],
|
|
10
|
+
"patterns": [
|
|
11
|
+
{
|
|
12
|
+
"include": "#comment"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"include": "#script-tag"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"include": "#style-tag"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"include": "#component-tag"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"include": "#slot-tag"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"include": "#html-tag"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"include": "#expression"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"repository": {
|
|
34
|
+
"comment": {
|
|
35
|
+
"begin": "<!--",
|
|
36
|
+
"end": "-->",
|
|
37
|
+
"name": "comment.block.html.zenith",
|
|
38
|
+
"captures": {
|
|
39
|
+
"0": {
|
|
40
|
+
"name": "punctuation.definition.comment.html.zenith"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"script-tag": {
|
|
45
|
+
"begin": "(<)(script)(?=\\s|>)",
|
|
46
|
+
"beginCaptures": {
|
|
47
|
+
"1": {
|
|
48
|
+
"name": "punctuation.definition.tag.begin.html.zenith"
|
|
49
|
+
},
|
|
50
|
+
"2": {
|
|
51
|
+
"name": "entity.name.tag.script.html.zenith"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"end": "(</)(script)\\s*(>)",
|
|
55
|
+
"endCaptures": {
|
|
56
|
+
"1": {
|
|
57
|
+
"name": "punctuation.definition.tag.begin.html.zenith"
|
|
58
|
+
},
|
|
59
|
+
"2": {
|
|
60
|
+
"name": "entity.name.tag.script.html.zenith"
|
|
61
|
+
},
|
|
62
|
+
"3": {
|
|
63
|
+
"name": "punctuation.definition.tag.end.html.zenith"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"name": "meta.tag.script.zenith",
|
|
67
|
+
"patterns": [
|
|
68
|
+
{
|
|
69
|
+
"include": "#script-tag-open"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"include": "#script-content"
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
"script-tag-open": {
|
|
77
|
+
"begin": "(?<=[tT])(?=\\s|>)",
|
|
78
|
+
"end": "(>)",
|
|
79
|
+
"endCaptures": {
|
|
80
|
+
"1": {
|
|
81
|
+
"name": "punctuation.definition.tag.end.html.zenith"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"name": "meta.tag.script.start.html.zenith",
|
|
85
|
+
"patterns": [
|
|
86
|
+
{
|
|
87
|
+
"include": "#tag-attributes"
|
|
88
|
+
}
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
"script-content": {
|
|
92
|
+
"begin": "(?<=>)",
|
|
93
|
+
"end": "(?=</script)",
|
|
94
|
+
"name": "source.ts.embedded.zenith",
|
|
95
|
+
"patterns": [
|
|
96
|
+
{
|
|
97
|
+
"include": "#state-declaration"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"include": "#lifecycle-hooks"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"include": "source.ts"
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
"style-tag": {
|
|
108
|
+
"begin": "(<)(style)(?=\\s|>)",
|
|
109
|
+
"beginCaptures": {
|
|
110
|
+
"1": {
|
|
111
|
+
"name": "punctuation.definition.tag.begin.html.zenith"
|
|
112
|
+
},
|
|
113
|
+
"2": {
|
|
114
|
+
"name": "entity.name.tag.style.html.zenith"
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"end": "(</)(style)\\s*(>)",
|
|
118
|
+
"endCaptures": {
|
|
119
|
+
"1": {
|
|
120
|
+
"name": "punctuation.definition.tag.begin.html.zenith"
|
|
121
|
+
},
|
|
122
|
+
"2": {
|
|
123
|
+
"name": "entity.name.tag.style.html.zenith"
|
|
124
|
+
},
|
|
125
|
+
"3": {
|
|
126
|
+
"name": "punctuation.definition.tag.end.html.zenith"
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"name": "meta.tag.style.zenith",
|
|
130
|
+
"patterns": [
|
|
131
|
+
{
|
|
132
|
+
"include": "#style-tag-open"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"include": "#style-content"
|
|
136
|
+
}
|
|
137
|
+
]
|
|
138
|
+
},
|
|
139
|
+
"style-tag-open": {
|
|
140
|
+
"begin": "(?<=[eE])(?=\\s|>)",
|
|
141
|
+
"end": "(>)",
|
|
142
|
+
"endCaptures": {
|
|
143
|
+
"1": {
|
|
144
|
+
"name": "punctuation.definition.tag.end.html.zenith"
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"name": "meta.tag.style.start.html.zenith",
|
|
148
|
+
"patterns": [
|
|
149
|
+
{
|
|
150
|
+
"include": "#tag-attributes"
|
|
151
|
+
}
|
|
152
|
+
]
|
|
153
|
+
},
|
|
154
|
+
"style-content": {
|
|
155
|
+
"begin": "(?<=>)",
|
|
156
|
+
"end": "(?=</style)",
|
|
157
|
+
"name": "source.css.embedded.zenith",
|
|
158
|
+
"patterns": [
|
|
159
|
+
{
|
|
160
|
+
"include": "source.css"
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
"state-declaration": {
|
|
165
|
+
"match": "(?<=^|\\s)(state)\\s+([a-zA-Z_$][a-zA-Z0-9_$]*)\\s*(=)",
|
|
166
|
+
"captures": {
|
|
167
|
+
"1": {
|
|
168
|
+
"name": "storage.type.state.zenith"
|
|
169
|
+
},
|
|
170
|
+
"2": {
|
|
171
|
+
"name": "variable.other.readwrite.zenith"
|
|
172
|
+
},
|
|
173
|
+
"3": {
|
|
174
|
+
"name": "keyword.operator.assignment.zenith"
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"lifecycle-hooks": {
|
|
179
|
+
"match": "\\b(zenOnMount|zenOnDestroy|zenOnUpdate|zenEffect|onMount|onDestroy|onUpdate)\\b",
|
|
180
|
+
"name": "support.function.lifecycle.zenith"
|
|
181
|
+
},
|
|
182
|
+
"component-tag": {
|
|
183
|
+
"patterns": [
|
|
184
|
+
{
|
|
185
|
+
"begin": "(<)([A-Z][a-zA-Z0-9]*)(?=\\s|/?>)",
|
|
186
|
+
"beginCaptures": {
|
|
187
|
+
"1": {
|
|
188
|
+
"name": "punctuation.definition.tag.begin.html.zenith"
|
|
189
|
+
},
|
|
190
|
+
"2": {
|
|
191
|
+
"name": "entity.name.tag.component.zenith support.class.component.zenith"
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
"end": "(/?>)",
|
|
195
|
+
"endCaptures": {
|
|
196
|
+
"1": {
|
|
197
|
+
"name": "punctuation.definition.tag.end.html.zenith"
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
"name": "meta.tag.component.start.zenith",
|
|
201
|
+
"patterns": [
|
|
202
|
+
{
|
|
203
|
+
"include": "#tag-attributes"
|
|
204
|
+
}
|
|
205
|
+
]
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"match": "(</)(\\s*)([A-Z][a-zA-Z0-9]*)(\\s*)(>)",
|
|
209
|
+
"captures": {
|
|
210
|
+
"1": {
|
|
211
|
+
"name": "punctuation.definition.tag.begin.html.zenith"
|
|
212
|
+
},
|
|
213
|
+
"3": {
|
|
214
|
+
"name": "entity.name.tag.component.zenith support.class.component.zenith"
|
|
215
|
+
},
|
|
216
|
+
"5": {
|
|
217
|
+
"name": "punctuation.definition.tag.end.html.zenith"
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
"name": "meta.tag.component.end.zenith"
|
|
221
|
+
}
|
|
222
|
+
]
|
|
223
|
+
},
|
|
224
|
+
"slot-tag": {
|
|
225
|
+
"match": "(<)(slot)(\\s*)(/?>)",
|
|
226
|
+
"captures": {
|
|
227
|
+
"1": {
|
|
228
|
+
"name": "punctuation.definition.tag.begin.html.zenith"
|
|
229
|
+
},
|
|
230
|
+
"2": {
|
|
231
|
+
"name": "entity.name.tag.slot.zenith keyword.control.slot.zenith"
|
|
232
|
+
},
|
|
233
|
+
"4": {
|
|
234
|
+
"name": "punctuation.definition.tag.end.html.zenith"
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
"name": "meta.tag.slot.zenith"
|
|
238
|
+
},
|
|
239
|
+
"html-tag": {
|
|
240
|
+
"patterns": [
|
|
241
|
+
{
|
|
242
|
+
"begin": "(<)([a-z][a-zA-Z0-9-]*)(?=\\s|/?>)",
|
|
243
|
+
"beginCaptures": {
|
|
244
|
+
"1": {
|
|
245
|
+
"name": "punctuation.definition.tag.begin.html.zenith"
|
|
246
|
+
},
|
|
247
|
+
"2": {
|
|
248
|
+
"name": "entity.name.tag.html.zenith"
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
"end": "(/?>)",
|
|
252
|
+
"endCaptures": {
|
|
253
|
+
"1": {
|
|
254
|
+
"name": "punctuation.definition.tag.end.html.zenith"
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
"name": "meta.tag.html.start.zenith",
|
|
258
|
+
"patterns": [
|
|
259
|
+
{
|
|
260
|
+
"include": "#tag-attributes"
|
|
261
|
+
}
|
|
262
|
+
]
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"match": "(</)(\\s*)([a-z][a-zA-Z0-9-]*)(\\s*)(>)",
|
|
266
|
+
"captures": {
|
|
267
|
+
"1": {
|
|
268
|
+
"name": "punctuation.definition.tag.begin.html.zenith"
|
|
269
|
+
},
|
|
270
|
+
"3": {
|
|
271
|
+
"name": "entity.name.tag.html.zenith"
|
|
272
|
+
},
|
|
273
|
+
"5": {
|
|
274
|
+
"name": "punctuation.definition.tag.end.html.zenith"
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
"name": "meta.tag.html.end.zenith"
|
|
278
|
+
}
|
|
279
|
+
]
|
|
280
|
+
},
|
|
281
|
+
"tag-attributes": {
|
|
282
|
+
"patterns": [
|
|
283
|
+
{
|
|
284
|
+
"include": "#attribute-expression"
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"include": "#attribute-event-handler"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"include": "#attribute-bind"
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
"include": "#attribute-quoted"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"include": "#attribute-boolean"
|
|
297
|
+
}
|
|
298
|
+
]
|
|
299
|
+
},
|
|
300
|
+
"attribute-expression": {
|
|
301
|
+
"begin": "([a-zA-Z_:][a-zA-Z0-9_:-]*)\\s*(=)\\s*(\\{)",
|
|
302
|
+
"beginCaptures": {
|
|
303
|
+
"1": {
|
|
304
|
+
"name": "entity.other.attribute-name.html.zenith"
|
|
305
|
+
},
|
|
306
|
+
"2": {
|
|
307
|
+
"name": "punctuation.separator.key-value.html.zenith"
|
|
308
|
+
},
|
|
309
|
+
"3": {
|
|
310
|
+
"name": "punctuation.section.embedded.begin.zenith"
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
"end": "(\\})",
|
|
314
|
+
"endCaptures": {
|
|
315
|
+
"1": {
|
|
316
|
+
"name": "punctuation.section.embedded.end.zenith"
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
"name": "meta.attribute.expression.zenith",
|
|
320
|
+
"contentName": "source.ts.embedded.zenith",
|
|
321
|
+
"patterns": [
|
|
322
|
+
{
|
|
323
|
+
"include": "source.ts"
|
|
324
|
+
}
|
|
325
|
+
]
|
|
326
|
+
},
|
|
327
|
+
"attribute-event-handler": {
|
|
328
|
+
"begin": "(on[A-Z][a-zA-Z]*|onclick|onchange|onsubmit|oninput|onkeydown|onkeyup|onmouseenter|onmouseleave)\\s*(=)\\s*(\\{)",
|
|
329
|
+
"beginCaptures": {
|
|
330
|
+
"1": {
|
|
331
|
+
"name": "entity.other.attribute-name.event.html.zenith"
|
|
332
|
+
},
|
|
333
|
+
"2": {
|
|
334
|
+
"name": "punctuation.separator.key-value.html.zenith"
|
|
335
|
+
},
|
|
336
|
+
"3": {
|
|
337
|
+
"name": "punctuation.section.embedded.begin.zenith"
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
"end": "(\\})",
|
|
341
|
+
"endCaptures": {
|
|
342
|
+
"1": {
|
|
343
|
+
"name": "punctuation.section.embedded.end.zenith"
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
"name": "meta.attribute.event-handler.zenith",
|
|
347
|
+
"contentName": "source.ts.embedded.zenith",
|
|
348
|
+
"patterns": [
|
|
349
|
+
{
|
|
350
|
+
"include": "source.ts"
|
|
351
|
+
}
|
|
352
|
+
]
|
|
353
|
+
},
|
|
354
|
+
"attribute-bind": {
|
|
355
|
+
"begin": "(:)([a-zA-Z_][a-zA-Z0-9_-]*)\\s*(=)\\s*(\")",
|
|
356
|
+
"beginCaptures": {
|
|
357
|
+
"1": {
|
|
358
|
+
"name": "punctuation.definition.attribute-shorthand.bind.zenith"
|
|
359
|
+
},
|
|
360
|
+
"2": {
|
|
361
|
+
"name": "entity.other.attribute-name.html.zenith"
|
|
362
|
+
},
|
|
363
|
+
"3": {
|
|
364
|
+
"name": "punctuation.separator.key-value.html.zenith"
|
|
365
|
+
},
|
|
366
|
+
"4": {
|
|
367
|
+
"name": "punctuation.definition.string.begin.html.zenith"
|
|
368
|
+
}
|
|
369
|
+
},
|
|
370
|
+
"end": "(\")",
|
|
371
|
+
"endCaptures": {
|
|
372
|
+
"1": {
|
|
373
|
+
"name": "punctuation.definition.string.end.html.zenith"
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
"name": "meta.attribute.bind.zenith",
|
|
377
|
+
"contentName": "string.quoted.double.html.zenith"
|
|
378
|
+
},
|
|
379
|
+
"attribute-quoted": {
|
|
380
|
+
"begin": "([a-zA-Z_:][a-zA-Z0-9_:-]*)\\s*(=)\\s*",
|
|
381
|
+
"beginCaptures": {
|
|
382
|
+
"1": {
|
|
383
|
+
"name": "entity.other.attribute-name.html.zenith"
|
|
384
|
+
},
|
|
385
|
+
"2": {
|
|
386
|
+
"name": "punctuation.separator.key-value.html.zenith"
|
|
387
|
+
}
|
|
388
|
+
},
|
|
389
|
+
"end": "(?<=[\"'])|(?=\\s|/?>)",
|
|
390
|
+
"name": "meta.attribute.zenith",
|
|
391
|
+
"patterns": [
|
|
392
|
+
{
|
|
393
|
+
"begin": "\"",
|
|
394
|
+
"beginCaptures": {
|
|
395
|
+
"0": {
|
|
396
|
+
"name": "punctuation.definition.string.begin.html.zenith"
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
"end": "\"",
|
|
400
|
+
"endCaptures": {
|
|
401
|
+
"0": {
|
|
402
|
+
"name": "punctuation.definition.string.end.html.zenith"
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
"name": "string.quoted.double.html.zenith",
|
|
406
|
+
"patterns": [
|
|
407
|
+
{
|
|
408
|
+
"include": "#expression"
|
|
409
|
+
}
|
|
410
|
+
]
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
"begin": "'",
|
|
414
|
+
"beginCaptures": {
|
|
415
|
+
"0": {
|
|
416
|
+
"name": "punctuation.definition.string.begin.html.zenith"
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
"end": "'",
|
|
420
|
+
"endCaptures": {
|
|
421
|
+
"0": {
|
|
422
|
+
"name": "punctuation.definition.string.end.html.zenith"
|
|
423
|
+
}
|
|
424
|
+
},
|
|
425
|
+
"name": "string.quoted.single.html.zenith",
|
|
426
|
+
"patterns": [
|
|
427
|
+
{
|
|
428
|
+
"include": "#expression"
|
|
429
|
+
}
|
|
430
|
+
]
|
|
431
|
+
}
|
|
432
|
+
]
|
|
433
|
+
},
|
|
434
|
+
"attribute-boolean": {
|
|
435
|
+
"match": "(?<=\\s)([a-zA-Z_][a-zA-Z0-9_-]*)(?=\\s|/?>)",
|
|
436
|
+
"captures": {
|
|
437
|
+
"1": {
|
|
438
|
+
"name": "entity.other.attribute-name.html.zenith"
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
"name": "meta.attribute.boolean.zenith"
|
|
442
|
+
},
|
|
443
|
+
"expression": {
|
|
444
|
+
"begin": "(\\{)(?!\\{)",
|
|
445
|
+
"beginCaptures": {
|
|
446
|
+
"1": {
|
|
447
|
+
"name": "punctuation.section.embedded.begin.zenith"
|
|
448
|
+
}
|
|
449
|
+
},
|
|
450
|
+
"end": "(\\})",
|
|
451
|
+
"endCaptures": {
|
|
452
|
+
"1": {
|
|
453
|
+
"name": "punctuation.section.embedded.end.zenith"
|
|
454
|
+
}
|
|
455
|
+
},
|
|
456
|
+
"name": "meta.embedded.expression.zenith",
|
|
457
|
+
"contentName": "source.ts.embedded.zenith",
|
|
458
|
+
"patterns": [
|
|
459
|
+
{
|
|
460
|
+
"include": "source.ts"
|
|
461
|
+
}
|
|
462
|
+
]
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script setup="ts" lang="ts">
|
|
2
|
+
state count = 0
|
|
3
|
+
|
|
4
|
+
function increment() {
|
|
5
|
+
count = count + 1
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
function decrement() {
|
|
9
|
+
count = count - 1
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
zenOnMount(() => {
|
|
13
|
+
console.log('🚀 Zenith app mounted!')
|
|
14
|
+
})
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<div class="card" onClick={() => increment()} disabled>
|
|
18
|
+
<h1>Counter: {count}</h1>
|
|
19
|
+
<button onClick={() => increment()}>+</button>
|
|
20
|
+
<button onClick={() => decrement()}>-</button>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<Counter count={count} :data-id="myId" />
|
|
24
|
+
|
|
25
|
+
<style scoped>
|
|
26
|
+
.card {
|
|
27
|
+
padding: 1rem;
|
|
28
|
+
border-radius: 8px;
|
|
29
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
button {
|
|
33
|
+
margin: 0.5rem;
|
|
34
|
+
padding: 0.5rem 1rem;
|
|
35
|
+
}
|
|
36
|
+
</style>
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"lib": [
|
|
6
|
+
"ES2020"
|
|
7
|
+
],
|
|
8
|
+
"outDir": "./out",
|
|
9
|
+
"rootDir": "./src",
|
|
10
|
+
"strict": true,
|
|
11
|
+
"esModuleInterop": true,
|
|
12
|
+
"skipLibCheck": true,
|
|
13
|
+
"forceConsistentCasingInFileNames": true,
|
|
14
|
+
"declaration": true,
|
|
15
|
+
"declarationMap": true,
|
|
16
|
+
"sourceMap": true,
|
|
17
|
+
"moduleResolution": "node"
|
|
18
|
+
},
|
|
19
|
+
"include": [
|
|
20
|
+
"src/**/*"
|
|
21
|
+
],
|
|
22
|
+
"exclude": [
|
|
23
|
+
"node_modules",
|
|
24
|
+
"out"
|
|
25
|
+
]
|
|
26
|
+
}
|