diff options
| author | Christian Clason <c.clason@uni-graz.at> | 2023-06-12 09:54:30 -0600 |
|---|---|---|
| committer | Christian Clason <c.clason@uni-graz.at> | 2025-05-12 18:43:40 +0200 |
| commit | 692b051b09935653befdb8f7ba8afdb640adf17b (patch) | |
| tree | 167162b6b129ae04f68c5735078521a72917c742 /runtime/queries/goctl | |
| parent | feat(c-family): inherit injections (diff) | |
| download | nvim-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/goctl')
| -rw-r--r-- | runtime/queries/goctl/folds.scm | 11 | ||||
| -rw-r--r-- | runtime/queries/goctl/highlights.scm | 79 | ||||
| -rw-r--r-- | runtime/queries/goctl/indents.scm | 15 | ||||
| -rw-r--r-- | runtime/queries/goctl/injections.scm | 3 |
4 files changed, 108 insertions, 0 deletions
diff --git a/runtime/queries/goctl/folds.scm b/runtime/queries/goctl/folds.scm new file mode 100644 index 000000000..704928675 --- /dev/null +++ b/runtime/queries/goctl/folds.scm @@ -0,0 +1,11 @@ +[ + (typeGroupSpec) + (typeSingleSpec) + (typeStruct) + (serviceSpec) + (serviceBody) + (importStatement) + (serviceServerSpec) + (infoStatement) + (structType) +] @fold diff --git a/runtime/queries/goctl/highlights.scm b/runtime/queries/goctl/highlights.scm new file mode 100644 index 000000000..a4b809a1c --- /dev/null +++ b/runtime/queries/goctl/highlights.scm @@ -0,0 +1,79 @@ +; Key Symbol +"=" @operator + +[ + "." + "," + ":" + ";" +] @punctuation.delimiter + +[ + "(" + ")" + "{" + "}" + "[" + "]" +] @punctuation.bracket + +; Keywords +[ + "syntax" + "info" + "service" +] @keyword + +"import" @keyword.import + +"returns" @keyword.return + +[ + "type" + "struct" +] @keyword.type + +[ + "@doc" + "@handler" + "@server" +] @attribute + +; Service +(serviceName) @type + +; Httpmethod +(HTTPMETHOD) @keyword.operator + +; Field +(fieldType) @type.builtin + +(fieldName) @variable.member + +(anonymousField) @variable.member + +; Functions +(handlerValue) @function.method + +; Strings +(VALUE) @string + +(tag) @string.documentation + +(PATH) @string.special.path + +; Comments +(comment) @comment @spell + +(key) @variable.member + +(identValue) @string + +(DURATION) @number + +(NUMBER) @number + +; Struct +(structNameId) @type + +(body) @type diff --git a/runtime/queries/goctl/indents.scm b/runtime/queries/goctl/indents.scm new file mode 100644 index 000000000..ffa126905 --- /dev/null +++ b/runtime/queries/goctl/indents.scm @@ -0,0 +1,15 @@ +[ + (importGroup) + (typeGroupSpec) + (structType) + (infoStatement) + (serviceServerSpec) + (serviceSpec) +] @indent.begin + +[ + ")" + "}" +] @indent.branch @indent.end + +(comment) @indent.ignore diff --git a/runtime/queries/goctl/injections.scm b/runtime/queries/goctl/injections.scm new file mode 100644 index 000000000..a53abee57 --- /dev/null +++ b/runtime/queries/goctl/injections.scm @@ -0,0 +1,3 @@ +; Inject comment language for goctl +((comment) @injection.content + (#set! injection.language "comment")) |
