@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.
@@ -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.4.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 = "file:///Users/akollegger/Developer/gram-data/tree-sitter-gram"
16
- rev = "v0.4.0"
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,5 @@
1
+ name = "Gramdoc"
2
+ grammar = "gramdoc"
3
+ # Injected into gram doc comments only; not a standalone file type.
4
+ path_suffixes = []
5
+ word_characters = ["_"]
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gram-data/tree-sitter-gram",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "subject-oriented notation for structured data",
5
5
  "homepage": "https://gram-data.github.io",
6
6
  "repository": {
package/src/parser.c CHANGED
@@ -4722,7 +4722,7 @@ TS_PUBLIC const TSLanguage *tree_sitter_gram(void) {
4722
4722
  .max_reserved_word_set_size = 0,
4723
4723
  .metadata = {
4724
4724
  .major_version = 0,
4725
- .minor_version = 4,
4725
+ .minor_version = 5,
4726
4726
  .patch_version = 0,
4727
4727
  },
4728
4728
  };
Binary file
package/tree-sitter.json CHANGED
@@ -12,7 +12,7 @@
12
12
  }
13
13
  ],
14
14
  "metadata": {
15
- "version": "0.4.0",
15
+ "version": "0.5.0",
16
16
  "license": "ISC",
17
17
  "description": "subject-oriented notation for structured data",
18
18
  "links": {