Skip to content

Commit fc3f90c

Browse files
Remove grammar fields from extension manifests
Syntax highlighting (parser.wasm + highlights.scm) is now bundled in Athas core and served from the CDN by convention. Extensions no longer need to declare capabilities.grammar — the editor falls back to CDN paths automatically. This simplifies extensions to only declare tooling capabilities (LSP, formatter, linter). Updated docs, build script, and regenerated catalog files.
1 parent acea3e0 commit fc3f90c

46 files changed

Lines changed: 609 additions & 682 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CONTRIBUTING.md

Lines changed: 10 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
# Contributing Extensions
22

3-
This repository contains extensions for the [Athas](https://athas.dev) editor. Extensions can provide language support (syntax highlighting, LSP, formatting, linting), themes, icon themes, snippets, keymaps, and more.
3+
This repository contains extensions for the [Athas](https://athas.dev) editor. Extensions can provide language tooling support (LSP, formatting, linting, snippets), themes, icon themes, keymaps, and more.
4+
5+
Syntax highlighting is bundled in Athas core and is not managed by these extensions.
46

57
## Repository Structure
68

79
```
810
extensions/
911
bash/
1012
extension.json # Extension manifest
11-
parser.wasm # Tree-sitter WASM grammar
12-
highlights.scm # Tree-sitter highlight queries
1313
lua/
1414
extension.json # Extension manifest
15-
parser.wasm
16-
highlights.scm
1715
tooling.json # Platform-specific tooling (pre-built LSP, formatter, linter binaries)
1816
build.sh # Build script for tooling archives
1917
...
@@ -26,7 +24,6 @@ scripts/ # Validation and generation scripts
2624
- `extension.json` defines the extension manifest (category, capabilities, tool references)
2725
- `tooling.json` (optional) defines pre-built platform-specific binaries distributed as tarballs
2826
- Not every extension has a `tooling.json`. Extensions without one rely on runtime-installed tools
29-
- `query-sources.json` pins upstream Tree-sitter highlight query sources for opt-in languages
3027

3128
## Adding a New Extension
3229

@@ -41,7 +38,7 @@ scripts/ # Validation and generation scripts
4138
"name": "MyLang",
4239
"displayName": "MyLang",
4340
"version": "1.0.0",
44-
"description": "MyLang language support with syntax highlighting",
41+
"description": "MyLang language support with LSP",
4542
"publisher": "Athas",
4643
"categories": ["Language"],
4744
"languages": [
@@ -50,54 +47,23 @@ scripts/ # Validation and generation scripts
5047
"extensions": [".ml"],
5148
"aliases": ["MyLang"]
5249
}
53-
],
54-
"capabilities": {
55-
"grammar": {
56-
"wasmPath": "parser.wasm",
57-
"highlightQuery": "highlights.scm"
58-
}
59-
}
50+
]
6051
}
6152
```
6253

63-
3. Add the required files for your extension type (e.g., `parser.wasm` and `highlights.scm` for language extensions).
54+
3. Add capability entries in `capabilities` only for tooling provided by the extension (`lsp`, `formatter`, `linter`, snippets/commands as needed).
6455

65-
4. Update `registry.json` and `index.json` to include your extension.
66-
67-
5. Regenerate `manifests.json`:
56+
4. Regenerate generated files:
6857
```bash
6958
bun run scripts/generate-manifests.ts
59+
bun run scripts/build-extensions-index.ts
7060
```
7161

72-
6. Validate your extension:
62+
5. Validate your extension:
7363
```bash
7464
bun run scripts/validate.ts
7565
```
7666

77-
## Upstream Tree-sitter Queries
78-
79-
For language extensions, prefer pinned upstream queries instead of hand-editing
80-
`highlights.scm` directly.
81-
82-
1. Add an entry in `query-sources.json` with:
83-
- `repository` (e.g. `tree-sitter/tree-sitter-rust`)
84-
- `revision` (tag or commit SHA)
85-
- `queryPath` (usually `queries/highlights.scm`)
86-
- `targetPath` (extension `highlights.scm`)
87-
- optional `overridePath` (e.g. `highlights.override.scm`)
88-
- optional `replacements` for tiny deterministic patches
89-
2. Add/modify `<extension>/highlights.override.scm` for local Athas-specific rules.
90-
3. Run:
91-
```bash
92-
bun run scripts/sync-upstream-queries.ts
93-
```
94-
4. Verify:
95-
```bash
96-
bun run scripts/sync-upstream-queries.ts --check
97-
```
98-
99-
`highlights.scm` is treated as generated output for entries in `query-sources.json`.
100-
10167
## Extension Manifest Format
10268

10369
### Required Fields
@@ -111,7 +77,7 @@ For language extensions, prefer pinned upstream queries instead of hand-editing
11177

11278
### Categories
11379

114-
- `Language` - Language support (grammar, LSP, formatter, linter)
80+
- `Language` - Language tooling support (LSP, formatter, linter, snippets, commands)
11581
- `Theme` - Editor themes
11682
- `Snippets` - Code snippets
11783
- `Keymaps` - Keyboard shortcut presets
@@ -121,15 +87,6 @@ For language extensions, prefer pinned upstream queries instead of hand-editing
12187

12288
### Language Capabilities
12389

124-
#### Grammar
125-
126-
```json
127-
"grammar": {
128-
"wasmPath": "parser.wasm",
129-
"highlightQuery": "highlights.scm"
130-
}
131-
```
132-
13390
#### LSP
13491

13592
```json

README.md

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
Extensions for the [Athas](https://athas.dev) editor.
44

5+
Syntax highlighting is now bundled in Athas core by default. This repository focuses on
6+
language tooling extensions (LSP, formatter, linter, snippets), plus themes and icon themes.
7+
58
## Structure
69

710
Each extension lives under `extensions/{name}/`:
@@ -10,8 +13,6 @@ Each extension lives under `extensions/{name}/`:
1013
extensions/
1114
lua/
1215
extension.json # Extension manifest
13-
parser.wasm # Tree-sitter WASM grammar
14-
highlights.scm # Tree-sitter highlight queries
1516
tooling.json # Platform-specific tooling (LSP, formatter, linter binaries)
1617
build.sh # Build script for tooling archives
1718
```
@@ -26,21 +27,8 @@ Root-level files:
2627
```bash
2728
bun run scripts/validate.ts
2829
bun run scripts/generate-manifests.ts
29-
bun run scripts/sync-upstream-queries.ts
3030
```
3131

32-
## Upstream Query Sync
33-
34-
Tree-sitter highlight queries can be pinned to upstream grammar repositories via
35-
`query-sources.json`.
36-
37-
- `highlights.scm` is generated from pinned upstream sources.
38-
- Use `highlights.override.scm` for local Athas-specific fixes.
39-
- To verify everything is in sync:
40-
```bash
41-
bun run scripts/sync-upstream-queries.ts --check
42-
```
43-
4432
## Contributing
4533

4634
See [CONTRIBUTING.md](CONTRIBUTING.md).

extensions/bash/extension.json

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,40 @@
44
"name": "Bash",
55
"displayName": "Bash",
66
"version": "1.0.0",
7-
"description": "Bash/Shell script support with syntax highlighting and LSP",
7+
"description": "Bash/Shell script support with LSP",
88
"publisher": "Athas",
9-
"categories": ["Language"],
9+
"categories": [
10+
"Language"
11+
],
1012
"languages": [
1113
{
1214
"id": "bash",
13-
"extensions": [".sh", ".bash", ".zsh"],
14-
"aliases": ["Bash", "Shell", "sh"],
15-
"filenames": [".bashrc", ".zshrc", ".bash_profile", ".profile"]
15+
"extensions": [
16+
".sh",
17+
".bash",
18+
".zsh"
19+
],
20+
"aliases": [
21+
"Bash",
22+
"Shell",
23+
"sh"
24+
],
25+
"filenames": [
26+
".bashrc",
27+
".zshrc",
28+
".bash_profile",
29+
".profile"
30+
]
1631
}
1732
],
1833
"capabilities": {
19-
"grammar": {
20-
"wasmPath": "parser.wasm",
21-
"highlightQuery": "highlights.scm"
22-
},
2334
"lsp": {
2435
"name": "bash-language-server",
2536
"runtime": "bun",
2637
"package": "bash-language-server",
27-
"args": ["start"]
38+
"args": [
39+
"start"
40+
]
2841
}
2942
}
3043
}

extensions/c/extension.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"name": "C",
55
"displayName": "C",
66
"version": "1.0.0",
7-
"description": "C language support with syntax highlighting and LSP",
7+
"description": "C language support with LSP",
88
"publisher": "Athas",
99
"categories": [
1010
"Language"
@@ -22,10 +22,6 @@
2222
}
2323
],
2424
"capabilities": {
25-
"grammar": {
26-
"wasmPath": "parser.wasm",
27-
"highlightQuery": "highlights.scm"
28-
},
2925
"lsp": {
3026
"name": "clangd",
3127
"runtime": "binary",

extensions/c_sharp/extension.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"name": "CSharp",
55
"displayName": "C#",
66
"version": "1.0.0",
7-
"description": "C# language support with syntax highlighting and LSP",
7+
"description": "C# language support with LSP",
88
"publisher": "Athas",
99
"categories": [
1010
"Language"
@@ -23,10 +23,6 @@
2323
}
2424
],
2525
"capabilities": {
26-
"grammar": {
27-
"wasmPath": "parser.wasm",
28-
"highlightQuery": "highlights.scm"
29-
},
3026
"lsp": {
3127
"name": "omnisharp",
3228
"runtime": "binary",

extensions/cpp/extension.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"name": "C++",
55
"displayName": "C++",
66
"version": "1.0.0",
7-
"description": "C++ language support with syntax highlighting and LSP",
7+
"description": "C++ language support with LSP",
88
"publisher": "Athas",
99
"categories": [
1010
"Language"
@@ -27,10 +27,6 @@
2727
}
2828
],
2929
"capabilities": {
30-
"grammar": {
31-
"wasmPath": "parser.wasm",
32-
"highlightQuery": "highlights.scm"
33-
},
3430
"lsp": {
3531
"name": "clangd",
3632
"runtime": "binary",

extensions/css/extension.json

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,42 @@
44
"name": "CSS",
55
"displayName": "CSS",
66
"version": "1.0.0",
7-
"description": "CSS language support with syntax highlighting, LSP, and formatting",
7+
"description": "CSS language support with LSP and formatting",
88
"publisher": "Athas",
9-
"categories": ["Language"],
9+
"categories": [
10+
"Language"
11+
],
1012
"languages": [
1113
{
1214
"id": "css",
13-
"extensions": [".css", ".scss", ".sass", ".less"],
14-
"aliases": ["CSS"]
15+
"extensions": [
16+
".css",
17+
".scss",
18+
".sass",
19+
".less"
20+
],
21+
"aliases": [
22+
"CSS"
23+
]
1524
}
1625
],
1726
"capabilities": {
18-
"grammar": {
19-
"wasmPath": "parser.wasm",
20-
"highlightQuery": "highlights.scm"
21-
},
2227
"lsp": {
2328
"name": "vscode-css-language-server",
2429
"runtime": "bun",
2530
"package": "vscode-langservers-extracted",
26-
"args": ["--stdio"]
31+
"args": [
32+
"--stdio"
33+
]
2734
},
2835
"formatter": {
2936
"name": "prettier",
3037
"runtime": "bun",
3138
"package": "prettier",
32-
"args": ["--stdin-filepath", "${file}"]
39+
"args": [
40+
"--stdin-filepath",
41+
"${file}"
42+
]
3343
}
3444
}
3545
}

extensions/css/tooling.json

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
"capabilities": {
1212
"type": "language",
1313
"languageId": "css",
14-
"fileExtensions": ["css"],
15-
"aliases": ["CSS", "css"],
16-
"grammar": {
17-
"wasmPath": "parsers/tree-sitter-css.wasm",
18-
"highlightQuery": "queries/css/highlights.scm",
19-
"scopeName": "source.css"
20-
},
14+
"fileExtensions": [
15+
"css"
16+
],
17+
"aliases": [
18+
"CSS",
19+
"css"
20+
],
2121
"lsp": {
2222
"server": {
2323
"darwin-arm64": "lsp/node_modules/vscode-css-languageserver-bin/cssServerMain.js",
@@ -26,9 +26,15 @@
2626
"linux-arm64": "lsp/node_modules/vscode-css-languageserver-bin/cssServerMain.js",
2727
"win32-x64": "lsp/node_modules/vscode-css-languageserver-bin/cssServerMain.js"
2828
},
29-
"args": ["--stdio"],
30-
"fileExtensions": [".css"],
31-
"languageIds": ["css"]
29+
"args": [
30+
"--stdio"
31+
],
32+
"fileExtensions": [
33+
".css"
34+
],
35+
"languageIds": [
36+
"css"
37+
]
3238
}
3339
},
3440
"installation": {

extensions/dart/extension.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"name": "Dart",
55
"displayName": "Dart",
66
"version": "1.0.0",
7-
"description": "Dart language support with syntax highlighting and LSP",
7+
"description": "Dart language support with LSP",
88
"publisher": "Athas",
99
"categories": [
1010
"Language"
@@ -21,10 +21,6 @@
2121
}
2222
],
2323
"capabilities": {
24-
"grammar": {
25-
"wasmPath": "parser.wasm",
26-
"highlightQuery": "highlights.scm"
27-
},
2824
"lsp": {
2925
"name": "dart",
3026
"runtime": "binary",

0 commit comments

Comments
 (0)