Skip to content

Commit

Permalink
feat: add queries/indents.scm and fix highlights.scm
Browse files Browse the repository at this point in the history
  • Loading branch information
joker1007 committed Nov 16, 2023
1 parent 3411755 commit a6eaac4
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 5 deletions.
15 changes: 10 additions & 5 deletions queries/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@
[
"true"
"false"
] @type
] @boolean

[
"nil"
] @constant.builtin

[
"class"
"module"
"interface"
"type"
"def"
Expand Down Expand Up @@ -39,10 +44,12 @@
(module_name (constant) @type)
(interface_name (interface) @type)
(alias_name (variable) @type)
(type_variable) @constant
(namespace (constant) @constant)

(builtin_type) @type

(const_name) @constant
(const_name (constant) @constant)
(global_name) @property

(parameter (var_name) @variable.parameter)
Expand All @@ -53,13 +60,11 @@

(type (symbol_literal) @symbol)

(type (string_literal (escape_sequence) @escape))
(type (string_literal (escape_sequence) @string.escape))
(type (string_literal) @string)

(type (integer_literal) @number)

(constant) @constant


[
"="
Expand Down
24 changes: 24 additions & 0 deletions queries/indents.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[
(class_decl)
(module_decl)
(interface_decl)
(parameters)
(tuple_type)
(record_type)
] @indent.begin

[
"end"
")"
"]"
"}"
] @indent.end

[
"end"
")"
"}"
"]"
] @indent.branch

(comment) @indent.ignore

0 comments on commit a6eaac4

Please sign in to comment.