diff options
| author | 涵曦 <im.hanxi@gmail.com> | 2025-08-11 15:21:23 +0800 |
|---|---|---|
| committer | Christian Clason <ch.clason+github@icloud.com> | 2025-08-12 10:24:58 +0200 |
| commit | 13e3ce3bf41521551b8d1daf401d31938f62e7ef (patch) | |
| tree | 25ff798ff0db5b217d52e231a02e5e7a7fef539b /runtime | |
| parent | feat(parsers): update c3, c_sharp, desktop, editorconfig, fennel, gdshader, j... (diff) | |
| download | nvim-treesitter-13e3ce3bf41521551b8d1daf401d31938f62e7ef.tar nvim-treesitter-13e3ce3bf41521551b8d1daf401d31938f62e7ef.tar.gz nvim-treesitter-13e3ce3bf41521551b8d1daf401d31938f62e7ef.tar.bz2 nvim-treesitter-13e3ce3bf41521551b8d1daf401d31938f62e7ef.tar.lz nvim-treesitter-13e3ce3bf41521551b8d1daf401d31938f62e7ef.tar.xz nvim-treesitter-13e3ce3bf41521551b8d1daf401d31938f62e7ef.tar.zst nvim-treesitter-13e3ce3bf41521551b8d1daf401d31938f62e7ef.zip | |
feat(sproto): add parser
Diffstat (limited to 'runtime')
| -rw-r--r-- | runtime/queries/sproto/folds.scm | 6 | ||||
| -rw-r--r-- | runtime/queries/sproto/highlights.scm | 47 | ||||
| -rw-r--r-- | runtime/queries/sproto/indents.scm | 10 | ||||
| -rw-r--r-- | runtime/queries/sproto/injections.scm | 2 |
4 files changed, 65 insertions, 0 deletions
diff --git a/runtime/queries/sproto/folds.scm b/runtime/queries/sproto/folds.scm new file mode 100644 index 000000000..03253d108 --- /dev/null +++ b/runtime/queries/sproto/folds.scm @@ -0,0 +1,6 @@ +[ + (type_definition) + (protocol_definition) + (request_block) + (response_block) +] @fold diff --git a/runtime/queries/sproto/highlights.scm b/runtime/queries/sproto/highlights.scm new file mode 100644 index 000000000..cd86ed22d --- /dev/null +++ b/runtime/queries/sproto/highlights.scm @@ -0,0 +1,47 @@ +(comment) @comment @spell + +[ + "." + ":" +] @punctuation.delimiter + +"*" @operator + +[ + "request" + "response" +] @keyword + +(type_definition + name: (identifier) @type) + +(nested_type_definition + name: (identifier) @type) + +(type_specifier) @type + +[ + "integer" + "boolean" + "string" + "binary" + "double" +] @type.builtin + +(protocol_definition + name: (identifier) @function) + +(field_definition + name: (identifier) @property) + +(map_specifier + key: (identifier) @property) + +(integer) @number + +[ + "(" + ")" + "{" + "}" +] @punctuation.bracket diff --git a/runtime/queries/sproto/indents.scm b/runtime/queries/sproto/indents.scm new file mode 100644 index 000000000..33147d540 --- /dev/null +++ b/runtime/queries/sproto/indents.scm @@ -0,0 +1,10 @@ +[ + (type_definition) + (protocol_definition) + (request_block) + (response_block) +] @indent.begin + +"}" @indent.end @indent.branch + +(comment) @indent.auto diff --git a/runtime/queries/sproto/injections.scm b/runtime/queries/sproto/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/runtime/queries/sproto/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) |
