@gram-data/tree-sitter-gram 0.4.0 → 0.5.0
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/editors/zed/README.md +7 -0
- package/editors/zed/extension.toml +9 -3
- package/editors/zed/languages/gramdoc/config.toml +5 -0
- package/editors/zed/languages/gramdoc/highlights.scm +27 -0
- package/package.json +1 -1
- package/prebuilds/darwin-arm64/@gram-data+tree-sitter-gram.node +0 -0
- package/prebuilds/darwin-x64/@gram-data+tree-sitter-gram.node +0 -0
- package/prebuilds/linux-arm64/@gram-data+tree-sitter-gram.node +0 -0
- package/prebuilds/linux-x64/@gram-data+tree-sitter-gram.node +0 -0
- package/prebuilds/win32-arm64/@gram-data+tree-sitter-gram.node +0 -0
- package/prebuilds/win32-x64/@gram-data+tree-sitter-gram.node +0 -0
- package/src/parser.c +1 -1
- package/tree-sitter-gram.wasm +0 -0
- package/tree-sitter.json +1 -1
package/editors/zed/README.md
CHANGED
|
@@ -135,6 +135,9 @@ editors/zed/
|
|
|
135
135
|
│ ├── indents.scm
|
|
136
136
|
│ ├── locals.scm
|
|
137
137
|
│ └── injections.scm
|
|
138
|
+
│ └── gramdoc/
|
|
139
|
+
│ ├── config.toml # Injection-only language for `/** ... */` doc comments
|
|
140
|
+
│ └── highlights.scm # Copied from tree-sitter-gramdoc (see header comment)
|
|
138
141
|
├── test.gram # Example file for testing
|
|
139
142
|
└── .gitignore # Ignores grammars/ (populated by Zed from extension.toml)
|
|
140
143
|
```
|
|
@@ -143,6 +146,10 @@ Query files (`.scm`) in `languages/gram/` are symlinks to the canonical `queries
|
|
|
143
146
|
|
|
144
147
|
The `grammars/` directory is created by Zed when it loads the extension (it clones the grammar from the URL in `extension.toml`). It is gitignored. If you see a nested `editors/zed/grammars/gram/...` path, that is the cloned repo inside Zed’s cache; you can ignore or delete `editors/zed/grammars/` locally.
|
|
145
148
|
|
|
149
|
+
### Doc comments (gramdoc)
|
|
150
|
+
|
|
151
|
+
`/** ... */` comments in gram files are injected with the [gramdoc](https://github.com/gram-data/tree-sitter-gramdoc) language (`queries/injections.scm`). Zed only applies an injection when the language is registered, so the extension declares a second grammar, `[grammars.gramdoc]`, and an injection-only language in `languages/gramdoc/`. The gramdoc grammar is pinned by full commit SHA (Zed requires one); `languages/gramdoc/highlights.scm` is a copy from the same release. When bumping gramdoc, update the SHA in `extension.toml` and re-copy `highlights.scm` from that tag. `prepare-zed-extension.sh` only rewrites the `gram` grammar's `repository` and `rev`, never gramdoc's.
|
|
152
|
+
|
|
146
153
|
### Keeping the grammar revision in sync
|
|
147
154
|
|
|
148
155
|
The extension pins the tree-sitter-gram grammar with `repository` and `rev` in `extension.toml`. Zed uses that to fetch and build the parser. To keep it aligned with the latest version:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
id = "gram"
|
|
2
2
|
name = "Gram Language Support"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.5.0"
|
|
4
4
|
schema_version = 1
|
|
5
5
|
authors = ["Gram Data Contributors"]
|
|
6
6
|
description = "Support for Gram notation - composable data patterns"
|
|
@@ -12,5 +12,11 @@ capabilities = [
|
|
|
12
12
|
|
|
13
13
|
# path = "grammars/tree-sitter-gram"
|
|
14
14
|
[grammars.gram]
|
|
15
|
-
repository = "
|
|
16
|
-
rev = "
|
|
15
|
+
repository = "https://github.com/gram-data/tree-sitter-gram"
|
|
16
|
+
rev = "b3207d0d3befa4a722a7435b0b93d5c1fe206706"
|
|
17
|
+
|
|
18
|
+
# Doc comments (`/** ... */`) in gram files are injected with gramdoc.
|
|
19
|
+
# Zed needs a full commit SHA here: v0.2.0 of gram-data/tree-sitter-gramdoc.
|
|
20
|
+
[grammars.gramdoc]
|
|
21
|
+
repository = "https://github.com/gram-data/tree-sitter-gramdoc"
|
|
22
|
+
rev = "ee35f3a1d1c2db642c8d8cec7e6a91a1abff02d6"
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
; Copied from gram-data/tree-sitter-gramdoc v0.2.0 (queries/highlights.scm).
|
|
2
|
+
; gramdoc is injected into gram `/** ... */` doc comments (see queries/injections.scm).
|
|
3
|
+
|
|
4
|
+
; Name
|
|
5
|
+
(document (name) @title)
|
|
6
|
+
|
|
7
|
+
; Tag keywords
|
|
8
|
+
"@property" @keyword
|
|
9
|
+
"@alias" @keyword
|
|
10
|
+
"@label" @keyword
|
|
11
|
+
"@elements" @keyword
|
|
12
|
+
"@element" @keyword
|
|
13
|
+
"@source" @keyword
|
|
14
|
+
"@target" @keyword
|
|
15
|
+
(self_tag) @keyword
|
|
16
|
+
"@reference" @keyword
|
|
17
|
+
(tag_name) @keyword
|
|
18
|
+
|
|
19
|
+
; Tag arguments
|
|
20
|
+
(property_tag name: (identifier) @variable.parameter)
|
|
21
|
+
(label_tag name: (identifier) @type)
|
|
22
|
+
(cardinality) @number
|
|
23
|
+
(alias) @string
|
|
24
|
+
(reference_target) @string.special
|
|
25
|
+
|
|
26
|
+
; Descriptions
|
|
27
|
+
(description_line) @comment
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/parser.c
CHANGED
package/tree-sitter-gram.wasm
CHANGED
|
Binary file
|