mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-10 15:30:01 -04:00
feat(streamdevice_proto): add parser and queries
This commit is contained in:
parent
6e42d823ce
commit
5d9526e9b0
6 changed files with 149 additions and 0 deletions
90
runtime/queries/streamdevice_proto/highlights.scm
Normal file
90
runtime/queries/streamdevice_proto/highlights.scm
Normal file
|
|
@ -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
|
||||
21
runtime/queries/streamdevice_proto/indents.scm
Normal file
21
runtime/queries/streamdevice_proto/indents.scm
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
[
|
||||
(function)
|
||||
(handler)
|
||||
] @indent.begin
|
||||
|
||||
[
|
||||
"{"
|
||||
"}"
|
||||
"("
|
||||
")"
|
||||
] @indent.branch
|
||||
|
||||
[
|
||||
"}"
|
||||
")"
|
||||
] @indent.end
|
||||
|
||||
[
|
||||
(comment)
|
||||
(string)
|
||||
] @indent.auto
|
||||
5
runtime/queries/streamdevice_proto/injections.scm
Normal file
5
runtime/queries/streamdevice_proto/injections.scm
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
|
||||
((regex_pattern) @injection.content
|
||||
(#set! injection.language "regex"))
|
||||
22
runtime/queries/streamdevice_proto/locals.scm
Normal file
22
runtime/queries/streamdevice_proto/locals.scm
Normal file
|
|
@ -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"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue