aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md1
-rw-r--r--lockfile.json3
-rw-r--r--lua/nvim-treesitter/parsers.lua8
-rw-r--r--queries/smithy/highlights.scm114
4 files changed, 126 insertions, 0 deletions
diff --git a/README.md b/README.md
index 85f014b79..2a5061816 100644
--- a/README.md
+++ b/README.md
@@ -295,6 +295,7 @@ We are looking for maintainers to add more parsers and to write query files for
- [x] [scss](https://github.com/serenadeai/tree-sitter-scss) (maintained by @elianiva)
- [x] [slint](https://github.com/jrmoulton/tree-sitter-slint) (experimental, maintained by @jrmoulton)
- [x] [smali](https://github.com/amaanq/tree-sitter-smali) (experimental, maintained by @amaanq)
+- [x] [smithy](https://github.com/indoorvivants/tree-sitter-smithy) (maintained by @amaanq, @keynmol)
- [x] [solidity](https://github.com/YongJieYongJie/tree-sitter-solidity) (maintained by @YongJieYongJie)
- [x] [sparql](https://github.com/BonaBeavis/tree-sitter-sparql) (maintained by @BonaBeavis)
- [x] [sql](https://github.com/derekstride/tree-sitter-sql) (maintained by @derekstride)
diff --git a/lockfile.json b/lockfile.json
index 8d31e7edc..95394bc6d 100644
--- a/lockfile.json
+++ b/lockfile.json
@@ -368,6 +368,9 @@
"smali": {
"revision": "d7f535e176c928d33b0e202dd808ac247cacf2ff"
},
+ "smithy": {
+ "revision": "8516587df08b923e3bc6e6108b94abbafe7765c7"
+ },
"solidity": {
"revision": "52ed0880c0126df2f2c7693f215fe6f38e4a2e0a"
},
diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua
index a59f155a1..72132f5d6 100644
--- a/lua/nvim-treesitter/parsers.lua
+++ b/lua/nvim-treesitter/parsers.lua
@@ -639,6 +639,14 @@ list.smali = {
experimental = true,
}
+list.smithy = {
+ install_info = {
+ url = "https://github.com/indoorvivants/tree-sitter-smithy",
+ files = { "src/parser.c" },
+ },
+ maintainers = { "@amaanq", "@keynmol" },
+}
+
list.haskell = {
install_info = {
url = "https://github.com/tree-sitter/tree-sitter-haskell",
diff --git a/queries/smithy/highlights.scm b/queries/smithy/highlights.scm
new file mode 100644
index 000000000..07ee328f1
--- /dev/null
+++ b/queries/smithy/highlights.scm
@@ -0,0 +1,114 @@
+; Preproc
+
+(control_key) @preproc
+
+; Namespace
+
+(namespace) @namespace
+
+; Includes
+
+[
+ "use"
+] @include
+
+; Builtins
+
+(primitive) @type.builtin
+[
+ "enum"
+ "intEnum"
+ "list"
+ "map"
+ "set"
+] @type.builtin
+
+; Fields (Members)
+
+; (field) @field
+
+(key_identifier) @field
+(shape_member
+ (field) @field)
+(operation_field) @field
+(operation_error_field) @field
+
+; 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
+
+[
+ "namespace"
+ "service"
+ "structure"
+ "operation"
+ "union"
+ "resource"
+ "metadata"
+ "apply"
+ "for"
+ "with"
+] @keyword
+
+; Literals
+
+(string) @string
+(escape_sequence) @string.escape
+
+(number) @number
+
+(float) @float
+
+(boolean) @boolean
+
+(null) @constant.builtin
+
+; Misc
+
+[
+ "$"
+ "#"
+] @punctuation.special
+
+["{" "}"] @punctuation.bracket
+
+["(" ")"] @punctuation.bracket
+
+["[" "]"] @punctuation.bracket
+
+[
+ ":"
+ "."
+] @punctuation.delimiter
+
+; Comments
+
+[
+ (comment)
+ (documentation_comment)
+] @comment @spell