From 692b051b09935653befdb8f7ba8afdb640adf17b Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 12 Jun 2023 09:54:30 -0600 Subject: feat!: drop modules, general refactor and cleanup --- runtime/queries/smithy/highlights.scm | 114 ++++++++++++++++++++++++++++++++++ runtime/queries/smithy/injections.scm | 5 ++ 2 files changed, 119 insertions(+) create mode 100644 runtime/queries/smithy/highlights.scm create mode 100644 runtime/queries/smithy/injections.scm (limited to 'runtime/queries/smithy') diff --git a/runtime/queries/smithy/highlights.scm b/runtime/queries/smithy/highlights.scm new file mode 100644 index 000000000..14e1f20fd --- /dev/null +++ b/runtime/queries/smithy/highlights.scm @@ -0,0 +1,114 @@ +; Preproc +(control_key) @keyword.directive + +; Namespace +(namespace) @module + +; Includes +"use" @keyword.import + +; Builtins +(primitive) @type.builtin + +[ + "enum" + "intEnum" + "list" + "map" + "set" + "structure" + "union" + "namespace" + "service" + "operation" + "resource" +] @keyword.type + +; Fields (Members) +; (field) @variable.member +(key_identifier) @variable.member + +(shape_member + (field) @variable.member) + +(operation_field) @variable.member + +(operation_error_field) @variable.member + +; Constants +(enum_member + (enum_field) @constant) + +; Types +(identifier) @type + +(structure_resource + (shape_id) @type) + +; Attributes +(mixins + (shape_id) @attribute) + +(trait_statement + (shape_id + (#set! priority 105)) @attribute) + +; Operators +[ + "@" + "-" + "=" + ":=" +] @operator + +; Keywords +[ + "metadata" + "apply" + "for" + "with" +] @keyword + +; Literals +(string) @string + +(escape_sequence) @string.escape + +(number) @number + +(float) @number.float + +(boolean) @boolean + +(null) @constant.builtin + +; Misc +[ + "$" + "#" +] @punctuation.special + +[ + "{" + "}" +] @punctuation.bracket + +[ + "(" + ")" +] @punctuation.bracket + +[ + "[" + "]" +] @punctuation.bracket + +[ + ":" + "." +] @punctuation.delimiter + +; Comments +(comment) @comment @spell + +(documentation_comment) @comment.documentation @spell diff --git a/runtime/queries/smithy/injections.scm b/runtime/queries/smithy/injections.scm new file mode 100644 index 000000000..cb85ecaa1 --- /dev/null +++ b/runtime/queries/smithy/injections.scm @@ -0,0 +1,5 @@ +([ + (comment) + (documentation_comment) +] @injection.content + (#set! injection.language "comment")) -- cgit v1.2.3-70-g09d2