First working highlighting implementation

This commit is contained in:
Fabian Stamm 2024-10-02 19:26:48 +02:00
parent 0dbd7474e6
commit 748ef644ba
4 changed files with 33 additions and 4 deletions

View File

@ -8,4 +8,4 @@ repository = "https://git.hibas.dev/hibas123/jrpc-syntax-zed"
[grammars.jrpc]
repository = "https://git.hibas.dev/hibas123/tree-sitter-jrpc"
commit = "69a6f0444e0c52384d8b252e1c226565eec72c4f"
commit = "6763d967af5d748cc86fdcb97ab8f609a9b69c2c"

View File

@ -2,3 +2,4 @@ name = "JRPC"
grammar = "jrpc"
path_suffixes = ["jrpc"]
line_comments = ["// "]
brackets = [{ start = "{", end = "}", close = true, newline = true }]

View File

@ -1,4 +1,33 @@
[
"import"
"define"
"type"
"enum"
"service"
"notification"
] @keyword
(type) @type
(import_declaration source: (string) @string)
(define_declaration key: (identifier) @type.definition)
(type_declaration name: (identifier) @type.definition)
(attribute (pair key: (identifier) @attribute))
(enum_declaration name: (identifier) @type.definition)
(enum_value_declaration) @enum
(enum_value_assignment (identifier) @enum)
(enum_value_assignment (number) @number)
(service_declaration name: (identifier) @type.definition)
(function_decorator name: (identifier) @comment)
(service_function name: (identifier) @function)
(function_argument name: (identifier) @attribute)
(service_notification name: (identifier) @function)
(string) @string
(number) @number
(pair
key: (string) @property.name)

View File

@ -1 +0,0 @@
(object "}" @end) @indent