@tenzir/codemirror-lang-tql 0.5.2 → 0.5.3

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/README.md CHANGED
@@ -197,6 +197,7 @@ The highlight query's captures become these tags (`tqlCaptureTags`):
197
197
  | `punctuation` | `tags.punctuation` |
198
198
  | `punctuation.bracket` | `tags.bracket` |
199
199
  | `punctuation.delimiter` | `tags.separator` |
200
+ | `punctuation.special` | `tags.special(tags.punctuation)` |
200
201
 
201
202
  A capture without an entry takes the tag of the nearest capture it refines, so
202
203
  `function.builtin` would be a `function`. Pipeline operators (`function.operator`),
@@ -233,6 +234,12 @@ const extensions = [
233
234
  ];
234
235
  ```
235
236
 
237
+ An entry covers the captures that refine it, so `punctuation: null` also
238
+ leaves out the braces around an expression in a format string
239
+ (`punctuation.special`), which then take the color of the string. To color
240
+ them apart, give them their tag back with
241
+ `"punctuation.special": tqlCaptureTags["punctuation.special"]`.
242
+
236
243
  ## Editing
237
244
 
238
245
  - **Quote pairing:** `closeBrackets()` pairs `(`, `[`, `{`, and `"`, also
package/dist/index.cjs CHANGED
@@ -8,7 +8,7 @@ var brackets = ";; Auto-generated by tenzir/tree-sitter-tql/scripts/generate-bra
8
8
 
9
9
  var folds = ";; Auto-generated by tenzir/tree-sitter-tql/scripts/generate-folds.mjs. DO NOT EDIT.\n\n[\n (then_block)\n (else_block)\n (pipeline_block)\n (pipeline_expression)\n (match_statement)\n (match_arm)\n (list)\n (record)\n (frontmatter)\n] @fold\n";
10
10
 
11
- var highlights = ";; Auto-generated by tenzir/tree-sitter-tql/scripts/generate-highlights.mjs. DO NOT EDIT.\n\n[\n \"let\"\n \"if\"\n \"else\"\n \"match\"\n \"and\"\n \"or\"\n \"not\"\n \"move\"\n \"in\"\n \"this\"\n \"?\"\n \".\"\n \"...\"\n \"[\"\n \"]\"\n \"{\"\n \"}\"\n \":\"\n] @keyword\n\n[\n \"+\"\n \"-\"\n \"*\"\n \"/\"\n] @keyword\n\n\"_\" @variable.builtin\n\n\"null\" @constant.builtin\n\n[\n \"true\"\n \"false\"\n] @boolean\n\n(dollar_var) @variable.builtin\n(global_sigil) @keyword\n(metadata_sigil) @keyword\n(meta_selector) @attribute\n(number) @number\n(string) @string\n(format_expr) @string\n(ip) @constant.ip\n(subnet) @constant.subnet\n(time) @number.time\n(duration) @number.duration\n(frontmatter_open) @comment\n(frontmatter_close) @comment\n(comment) @comment\n\n(invocation\n operator: (entity) @function.operator)\n(call_expression\n (entity) @function.call)\n(call_expression\n method: (entity) @function.method)\n((identifier) @variable.builtin (#match? @variable.builtin \"^\\$[A-Za-z_]\\w*$\"))\n\n[\n \"(\"\n \")\"\n] @punctuation.bracket\n\n[\n \",\"\n] @punctuation.delimiter\n\n[\n \"=\"\n \"=>\"\n \"|\"\n \"..\"\n \"::\"\n \"==\"\n \"!=\"\n \">\"\n \">=\"\n \"<\"\n \"<=\"\n] @operator\n";
11
+ var highlights = ";; Auto-generated by tenzir/tree-sitter-tql/scripts/generate-highlights.mjs. DO NOT EDIT.\n\n[\n \"let\"\n \"if\"\n \"else\"\n \"match\"\n \"and\"\n \"or\"\n \"not\"\n \"move\"\n \"in\"\n \"this\"\n \"?\"\n \".\"\n \"...\"\n \":\"\n] @keyword\n\n[\n \"+\"\n \"-\"\n \"*\"\n \"/\"\n] @keyword\n\n\"_\" @variable.builtin\n\n\"null\" @constant.builtin\n\n[\n \"true\"\n \"false\"\n] @boolean\n\n(dollar_var) @variable.builtin\n(global_sigil) @keyword\n(metadata_sigil) @keyword\n(meta_selector) @attribute\n(number) @number\n(string) @string\n(format_expr) @string\n(ip) @constant.ip\n(subnet) @constant.subnet\n(time) @number.time\n(duration) @number.duration\n(frontmatter_open) @comment\n(frontmatter_close) @comment\n(comment) @comment\n\n(invocation\n operator: (entity) @function.operator)\n(call_expression\n (entity) @function.call)\n(call_expression\n method: (entity) @function.method)\n((identifier) @variable.builtin (#match? @variable.builtin \"^\\$[A-Za-z_]\\w*$\"))\n(then_block\n [\"{\" \"}\"] @punctuation.bracket)\n(else_block\n [\"{\" \"}\"] @punctuation.bracket)\n(pipeline_block\n [\"{\" \"}\"] @punctuation.bracket)\n(pipeline_expression\n [\"{\" \"}\"] @punctuation.bracket)\n(match_statement\n [\"{\" \"}\"] @punctuation.bracket)\n(match_arm\n [\"{\" \"}\"] @punctuation.bracket)\n(record\n [\"{\" \"}\"] @punctuation.bracket)\n(format_replacement\n [\"{\" \"}\"] @punctuation.special)\n\n[\n \"(\"\n \")\"\n \"[\"\n \"]\"\n] @punctuation.bracket\n\n[\n \",\"\n] @punctuation.delimiter\n\n[\n \"=\"\n \"=>\"\n \"|\"\n \"..\"\n \"::\"\n \"==\"\n \"!=\"\n \">\"\n \">=\"\n \"<\"\n \"<=\"\n] @operator\n";
12
12
 
13
13
  var indents = ";; Auto-generated by tenzir/tree-sitter-tql/scripts/generate-indents.mjs. DO NOT EDIT.\n\n[\n (then_block)\n (else_block)\n (pipeline_block)\n (pipeline_expression)\n (match_statement)\n (match_arm)\n (list)\n (record)\n] @indent\n\n[\n \"}\"\n \"]\"\n] @outdent\n\n[\n (string)\n (format_text)\n (comment)\n (frontmatter_body)\n] @indent.auto\n";
14
14
 
@@ -50,6 +50,7 @@ const tqlCaptureTags = {
50
50
  punctuation: highlight.tags.punctuation,
51
51
  "punctuation.bracket": highlight.tags.bracket,
52
52
  "punctuation.delimiter": highlight.tags.separator,
53
+ "punctuation.special": highlight.tags.special(highlight.tags.punctuation),
53
54
  };
54
55
  /** The entry of `table` for `capture` or the nearest capture it refines. */
55
56
  const lookupCapture = (table, capture) => {
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ var brackets = ";; Auto-generated by tenzir/tree-sitter-tql/scripts/generate-bra
6
6
 
7
7
  var folds = ";; Auto-generated by tenzir/tree-sitter-tql/scripts/generate-folds.mjs. DO NOT EDIT.\n\n[\n (then_block)\n (else_block)\n (pipeline_block)\n (pipeline_expression)\n (match_statement)\n (match_arm)\n (list)\n (record)\n (frontmatter)\n] @fold\n";
8
8
 
9
- var highlights = ";; Auto-generated by tenzir/tree-sitter-tql/scripts/generate-highlights.mjs. DO NOT EDIT.\n\n[\n \"let\"\n \"if\"\n \"else\"\n \"match\"\n \"and\"\n \"or\"\n \"not\"\n \"move\"\n \"in\"\n \"this\"\n \"?\"\n \".\"\n \"...\"\n \"[\"\n \"]\"\n \"{\"\n \"}\"\n \":\"\n] @keyword\n\n[\n \"+\"\n \"-\"\n \"*\"\n \"/\"\n] @keyword\n\n\"_\" @variable.builtin\n\n\"null\" @constant.builtin\n\n[\n \"true\"\n \"false\"\n] @boolean\n\n(dollar_var) @variable.builtin\n(global_sigil) @keyword\n(metadata_sigil) @keyword\n(meta_selector) @attribute\n(number) @number\n(string) @string\n(format_expr) @string\n(ip) @constant.ip\n(subnet) @constant.subnet\n(time) @number.time\n(duration) @number.duration\n(frontmatter_open) @comment\n(frontmatter_close) @comment\n(comment) @comment\n\n(invocation\n operator: (entity) @function.operator)\n(call_expression\n (entity) @function.call)\n(call_expression\n method: (entity) @function.method)\n((identifier) @variable.builtin (#match? @variable.builtin \"^\\$[A-Za-z_]\\w*$\"))\n\n[\n \"(\"\n \")\"\n] @punctuation.bracket\n\n[\n \",\"\n] @punctuation.delimiter\n\n[\n \"=\"\n \"=>\"\n \"|\"\n \"..\"\n \"::\"\n \"==\"\n \"!=\"\n \">\"\n \">=\"\n \"<\"\n \"<=\"\n] @operator\n";
9
+ var highlights = ";; Auto-generated by tenzir/tree-sitter-tql/scripts/generate-highlights.mjs. DO NOT EDIT.\n\n[\n \"let\"\n \"if\"\n \"else\"\n \"match\"\n \"and\"\n \"or\"\n \"not\"\n \"move\"\n \"in\"\n \"this\"\n \"?\"\n \".\"\n \"...\"\n \":\"\n] @keyword\n\n[\n \"+\"\n \"-\"\n \"*\"\n \"/\"\n] @keyword\n\n\"_\" @variable.builtin\n\n\"null\" @constant.builtin\n\n[\n \"true\"\n \"false\"\n] @boolean\n\n(dollar_var) @variable.builtin\n(global_sigil) @keyword\n(metadata_sigil) @keyword\n(meta_selector) @attribute\n(number) @number\n(string) @string\n(format_expr) @string\n(ip) @constant.ip\n(subnet) @constant.subnet\n(time) @number.time\n(duration) @number.duration\n(frontmatter_open) @comment\n(frontmatter_close) @comment\n(comment) @comment\n\n(invocation\n operator: (entity) @function.operator)\n(call_expression\n (entity) @function.call)\n(call_expression\n method: (entity) @function.method)\n((identifier) @variable.builtin (#match? @variable.builtin \"^\\$[A-Za-z_]\\w*$\"))\n(then_block\n [\"{\" \"}\"] @punctuation.bracket)\n(else_block\n [\"{\" \"}\"] @punctuation.bracket)\n(pipeline_block\n [\"{\" \"}\"] @punctuation.bracket)\n(pipeline_expression\n [\"{\" \"}\"] @punctuation.bracket)\n(match_statement\n [\"{\" \"}\"] @punctuation.bracket)\n(match_arm\n [\"{\" \"}\"] @punctuation.bracket)\n(record\n [\"{\" \"}\"] @punctuation.bracket)\n(format_replacement\n [\"{\" \"}\"] @punctuation.special)\n\n[\n \"(\"\n \")\"\n \"[\"\n \"]\"\n] @punctuation.bracket\n\n[\n \",\"\n] @punctuation.delimiter\n\n[\n \"=\"\n \"=>\"\n \"|\"\n \"..\"\n \"::\"\n \"==\"\n \"!=\"\n \">\"\n \">=\"\n \"<\"\n \"<=\"\n] @operator\n";
10
10
 
11
11
  var indents = ";; Auto-generated by tenzir/tree-sitter-tql/scripts/generate-indents.mjs. DO NOT EDIT.\n\n[\n (then_block)\n (else_block)\n (pipeline_block)\n (pipeline_expression)\n (match_statement)\n (match_arm)\n (list)\n (record)\n] @indent\n\n[\n \"}\"\n \"]\"\n] @outdent\n\n[\n (string)\n (format_text)\n (comment)\n (frontmatter_body)\n] @indent.auto\n";
12
12
 
@@ -48,6 +48,7 @@ const tqlCaptureTags = {
48
48
  punctuation: tags.punctuation,
49
49
  "punctuation.bracket": tags.bracket,
50
50
  "punctuation.delimiter": tags.separator,
51
+ "punctuation.special": tags.special(tags.punctuation),
51
52
  };
52
53
  /** The entry of `table` for `capture` or the nearest capture it refines. */
53
54
  const lookupCapture = (table, capture) => {
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
10
- "version": "0.5.2",
10
+ "version": "0.5.3",
11
11
  "description": "Tenzir Query Language (TQL) support for CodeMirror, backed by tree-sitter-tql",
12
12
  "keywords": [
13
13
  "codemirror",
@@ -49,7 +49,7 @@
49
49
  "@rollup/plugin-typescript": "^12.3.1",
50
50
  "rollup": "^4.68.2",
51
51
  "rollup-plugin-dts": "^6.5.1",
52
- "tree-sitter-tql": "1.5.0",
52
+ "tree-sitter-tql": "1.5.1",
53
53
  "tslib": "^2.9.1",
54
54
  "typescript": "^5.9.3",
55
55
  "web-tree-sitter": "^0.26.13"