From 583cd485b9e58966c786a9c6102f15093632aadd Mon Sep 17 00:00:00 2001 From: Sienna Meridian Satterwhite Date: Tue, 17 Feb 2026 00:11:37 +0000 Subject: [PATCH] fix(zed): restore highlights.scm - Zed requires local query files Zed extensions do not automatically use queries from fetched grammars. They require local query files in languages// directory. Restored highlights.scm by copying from tree-sitter-storybook/queries/. The regression test ensures this stays in sync with the source of truth. Also updated grammar revision to 0590c13 (latest remote commit). --- zed-storybook/extension.toml | 2 +- .../languages/storybook/highlights.scm | 162 ++++++++++++++++++ 2 files changed, 163 insertions(+), 1 deletion(-) create mode 100644 zed-storybook/languages/storybook/highlights.scm diff --git a/zed-storybook/extension.toml b/zed-storybook/extension.toml index ec4f642..a14853d 100644 --- a/zed-storybook/extension.toml +++ b/zed-storybook/extension.toml @@ -8,7 +8,7 @@ repository = "https://github.com/r3t-studios/storybook" [grammars.storybook] repository = "https://github.com/r3t-studios/storybook" -rev = "37793cea0d84be1f004da2c80fce7bd513eb5f7b" +rev = "0590c133c73434a9d2afbe2df663fbb66a86c5af" path = "tree-sitter-storybook" [language_servers.storybook-lsp] diff --git a/zed-storybook/languages/storybook/highlights.scm b/zed-storybook/languages/storybook/highlights.scm new file mode 100644 index 0000000..cc23da7 --- /dev/null +++ b/zed-storybook/languages/storybook/highlights.scm @@ -0,0 +1,162 @@ +; Highlights query for Storybook DSL +; Maps grammar nodes to standard highlight groups + +; Comments +(line_comment) @comment.line +(block_comment) @comment.block + +; Keywords - Declaration keywords +[ + "character" + "template" + "life_arc" + "schedule" + "behavior" + "institution" + "relationship" + "location" + "species" + "enum" + "state" + "concept" + "sub_concept" + "concept_comparison" +] @keyword.declaration + +; Keywords - Control flow and modifiers +[ + "and" + "or" + "not" + "on" + "enter" + "strict" +] @keyword.control + +; Keywords - Import/module +[ + "use" + "include" + "from" +] @keyword.import + +; Keywords - Special +[ + "as" + "self" + "other" + "remove" + "append" + "is" +] @keyword.special + +; any type keyword +(any_type) @keyword.special + +; Boolean literals +[ + "true" + "false" +] @constant.builtin.boolean + +; Numbers +(integer) @constant.numeric.integer +(float) @constant.numeric.float +(time) @constant.numeric.time +(duration) @constant.numeric.duration + +; Strings +(string) @string + +; Identifiers in different contexts +(character_declaration name: (identifier) @type.character) +(template_declaration name: (identifier) @type.template) +(life_arc_declaration name: (identifier) @type.life_arc) +(schedule_declaration name: (identifier) @type.schedule) +(behavior_declaration name: (identifier) @type.behavior) +(institution_declaration name: (identifier) @type.institution) +(relationship_declaration name: (identifier) @type.relationship) +(location_declaration name: (identifier) @type.location) +(species_declaration name: (identifier) @type.species) +(enum_declaration name: (identifier) @type.enum) +(state_block name: (identifier) @type.state) +(concept_declaration name: (identifier) @type.concept) +(sub_concept parent: (identifier) @type.concept) +(sub_concept name: (identifier) @type.sub_concept) +(concept_comparison name: (identifier) @type.concept_comparison) +(variant_pattern name: (identifier) @type.variant) +(template_declaration species: (identifier) @type.builtin) + +; Field names +(field name: (dotted_path) @property) +(sub_concept_field name: (identifier) @property) + +; Species reference +(character_declaration species: (identifier) @type.builtin) + +; Paths and identifiers +(path) @namespace +(identifier) @variable + +; Prose blocks - tag and content +(prose_block tag: (identifier) @tag) +(prose_block marker: (prose_marker) @punctuation.delimiter) +(prose_content) @markup.raw + +; Operators +[ + ">" + ">=" + "<" + "<=" + "->" + "is" +] @operator + +; Punctuation +[ + "{" + "}" +] @punctuation.bracket + +[ + "(" + ")" +] @punctuation.bracket + +[ + "[" + "]" +] @punctuation.bracket + +[ + ":" + "::" + ";" + "," + "." + ".." + "*" + "@" +] @punctuation.delimiter + +; Behavior tree nodes +(action_node (identifier) @function.action) + +; Transitions +(transition "->" @operator.transition) +(transition target: (identifier) @type.state) + +; Schedule blocks +(schedule_block name: (identifier) @function.schedule_block) + +; Override operations +(override "@" @keyword.override) +(override_op "remove" @keyword.override) +(override_op "append" @keyword.override) + +; Template clause +(template_clause "from" @keyword.import) + +; Error handling +(ERROR) @error