diff --git a/SUPPORTED_LANGUAGES.md b/SUPPORTED_LANGUAGES.md index b2c006f84..0b728fb65 100644 --- a/SUPPORTED_LANGUAGES.md +++ b/SUPPORTED_LANGUAGES.md @@ -275,6 +275,7 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | @steelsojka [ssh_config](https://github.com/tree-sitter-grammars/tree-sitter-ssh-config) | unstable | `HFIJL` | @ObserverOfTime [starlark](https://github.com/tree-sitter-grammars/tree-sitter-starlark) | unstable | `HFIJL` | @amaanq [strace](https://github.com/sigmaSd/tree-sitter-strace) | unstable | `H  J ` | @amaanq +[streamdevice_proto](https://github.com/minijackson/tree-sitter-streamdevice-proto)[^streamdevice_proto] | unstable | `H IJL` | @minijackson [styled](https://github.com/mskelton/tree-sitter-styled) | unstable | `HFIJ ` | @mskelton [supercollider](https://github.com/madskjeldgaard/tree-sitter-supercollider) | unstable | `HFIJL` | @madskjeldgaard [superhtml](https://github.com/kristoff-it/superhtml) | unstable | `H  J ` | @rockorager @@ -360,4 +361,5 @@ jsx (queries only)[^jsx] | unstable | `HFIJ ` | @steelsojka [^sflog]: Salesforce debug log [^slang]: Shader Slang [^snl]: EPICS Sequencer's SNL files +[^streamdevice_proto]: EPICS StreamDevice .proto files diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 595191dde..59e18a879 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -2161,6 +2161,15 @@ return { maintainers = { '@amaanq' }, tier = 2, }, + streamdevice_proto = { + install_info = { + revision = 'b638715ae8deb91c8bfedd7ff1fb27650f6e0309', + url = 'https://github.com/minijackson/tree-sitter-streamdevice-proto', + }, + maintainers = { '@minijackson' }, + readme_note = 'EPICS StreamDevice .proto files', + tier = 2, + }, styled = { install_info = { revision = '319cdcaa0346ba6db668a222d938e5c3569e2a51', diff --git a/runtime/queries/streamdevice_proto/highlights.scm b/runtime/queries/streamdevice_proto/highlights.scm new file mode 100644 index 000000000..96607b6c6 --- /dev/null +++ b/runtime/queries/streamdevice_proto/highlights.scm @@ -0,0 +1,90 @@ +(comment) @comment @spell + +(variable_name) @constant + +(enum_constant) @constant + +(ascii_name) @constant.builtin + +"=" @operator + +[ + (function_name) + (command_name) + (handler_name) +] @function + +((command_name) @function.builtin + (#any-of? @function.builtin "out" "in" "wait" "event" "exec" "disconnect" "connect")) + +((handler_name) @function.builtin + (#any-of? @function.builtin "mismatch" "writetimeout" "replytimeout" "readtimeout" "init")) + +[ + "{" + "}" + "[" + "]" + "(" + ")" + "<" + ">" +] @punctuation.bracket + +[ + "$" + "\\$" + "@" + "/" + "#/" +] @punctuation.special + +(variable_expansion + [ + "\\${" + "}" + ] @punctuation.special) + +(format_converter + [ + "%" + "{" + "}" + "[" + "]" + "(" + ")" + "<" + ">" + "#/" + "/" + ] @punctuation.special) + +[ + "|" + ";" + "," + "." +] @punctuation.delimiter + +(quoted_literal) @string + +(escape_sequence) @string.escape + +(format_converter) @function.builtin + +(checksum_flag) @operator + +(checksum) @function + +(regex_pattern) @string.regexp + +(time_conversion_spec) @constant.builtin + +(keyword) @keyword + +(record_name) @constant + +(field_name) @variable.member + +(number) @number diff --git a/runtime/queries/streamdevice_proto/indents.scm b/runtime/queries/streamdevice_proto/indents.scm new file mode 100644 index 000000000..f122f426e --- /dev/null +++ b/runtime/queries/streamdevice_proto/indents.scm @@ -0,0 +1,21 @@ +[ + (function) + (handler) +] @indent.begin + +[ + "{" + "}" + "(" + ")" +] @indent.branch + +[ + "}" + ")" +] @indent.end + +[ + (comment) + (string) +] @indent.auto diff --git a/runtime/queries/streamdevice_proto/injections.scm b/runtime/queries/streamdevice_proto/injections.scm new file mode 100644 index 000000000..0edb4aa68 --- /dev/null +++ b/runtime/queries/streamdevice_proto/injections.scm @@ -0,0 +1,5 @@ +((comment) @injection.content + (#set! injection.language "comment")) + +((regex_pattern) @injection.content + (#set! injection.language "regex")) diff --git a/runtime/queries/streamdevice_proto/locals.scm b/runtime/queries/streamdevice_proto/locals.scm new file mode 100644 index 000000000..260e937c6 --- /dev/null +++ b/runtime/queries/streamdevice_proto/locals.scm @@ -0,0 +1,22 @@ +(source_file) @local.scope + +; The content of a function is a scope, not the whole function block. +; Else, the function is defined inside itself +(function + . + (function_name) + . + (_) @local.scope) + +(function + . + (function_name) @local.definition.function) + +(assignment + (variable_name) @local.definition.var) + +(variable_name) @local.reference + +((handler + (function_name) @local.reference) + (#set! reference.kind "call"))