Skip to content

Commit

Permalink
switch to tree-sitter-ron (helix-editor#8624)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabydd authored and Schuyler Mortimer committed Jul 10, 2024
1 parent b1edc66 commit 7a31b22
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 4 deletions.
5 changes: 4 additions & 1 deletion languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,10 @@ file-types = ["ron"]
roots = []
comment-token = "//"
indent = { tab-width = 4, unit = " " }
grammar = "rust"

[[grammar]]
name = "ron"
source = { git = "https://github.com/zee-editor/tree-sitter-ron", rev = "7762d709a0f7c1f9e269d0125a2e8a7a69006146" }

[[language]]
name = "robot"
Expand Down
44 changes: 43 additions & 1 deletion runtime/queries/ron/highlights.scm
Original file line number Diff line number Diff line change
@@ -1 +1,43 @@
; inherits: rust
; Literals
;------------

(string) @string
(boolean) @constant.builtin.boolean
(integer) @constant.numeric.integer
(float) @constant.numeric.float
(char) @constant.character

; Structs
;------------

(enum_variant) @type.enum.variant
(struct_entry (_) @variable.other.member ":")
(struct_name (identifier)) @type




; Comments
;------------

(line_comment) @comment.line
(block_comment) @comment.block


; Punctuation
;------------

"," @punctuation.delimiter
":" @punctuation.delimiter

"(" @punctuation.bracket
")" @punctuation.bracket
"[" @punctuation.bracket
"]" @punctuation.bracket
"{" @punctuation.bracket
"}" @punctuation.bracket


; Special
;------------
(escape_sequence) @constant.character.escape
13 changes: 12 additions & 1 deletion runtime/queries/ron/indents.scm
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
; inherits: rust
[
(array)
(map)
(tuple)
(struct)
] @indent

[
"}"
"]"
")"
] @outdent
3 changes: 2 additions & 1 deletion runtime/queries/ron/injections.scm
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
; inherits: rust
([(line_comment) (block_comment)] @injection.content
(#set! injection.language "comment"))

0 comments on commit 7a31b22

Please sign in to comment.