aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/queries/smithy
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2023-06-12 09:54:30 -0600
committerChristian Clason <c.clason@uni-graz.at>2025-05-12 18:43:40 +0200
commit692b051b09935653befdb8f7ba8afdb640adf17b (patch)
tree167162b6b129ae04f68c5735078521a72917c742 /runtime/queries/smithy
parentfeat(c-family): inherit injections (diff)
downloadnvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.gz
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.bz2
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.lz
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.xz
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.tar.zst
nvim-treesitter-692b051b09935653befdb8f7ba8afdb640adf17b.zip
feat!: drop modules, general refactor and cleanup
Diffstat (limited to 'runtime/queries/smithy')
-rw-r--r--runtime/queries/smithy/highlights.scm114
-rw-r--r--runtime/queries/smithy/injections.scm5
2 files changed, 119 insertions, 0 deletions
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"))