mirror of https://github.com/helix-editor/helix
languages: add CEL, SpiceDB schema language (#9296)
* languages: add CEL language and grammar * languages: add spicedb schema language * chore: docgen * runtime/queries: refine spicedb & cel highlights Co-authored-by: Michael Davis <mcarsondavis@gmail.com> * languages: update spicedb --------- Co-authored-by: Michael Davis <mcarsondavis@gmail.com>pull/9415/head
parent
7d8ce1a400
commit
d9f7aaacaf
@ -0,0 +1,66 @@
|
||||
; Operators
|
||||
|
||||
[
|
||||
"-"
|
||||
"!"
|
||||
"*"
|
||||
"/"
|
||||
"&&"
|
||||
"%"
|
||||
"+"
|
||||
"<"
|
||||
"<="
|
||||
"=="
|
||||
">"
|
||||
">="
|
||||
"||"
|
||||
] @operator
|
||||
|
||||
; Keywords
|
||||
|
||||
[
|
||||
"in"
|
||||
] @keyword
|
||||
|
||||
; Function calls
|
||||
|
||||
(call_expression
|
||||
function: (identifier) @function)
|
||||
|
||||
(member_call_expression
|
||||
function: (identifier) @function)
|
||||
|
||||
; Identifiers
|
||||
|
||||
(select_expression
|
||||
operand: (identifier) @type)
|
||||
|
||||
(select_expression
|
||||
operand: (select_expression
|
||||
member: (identifier) @type))
|
||||
|
||||
(identifier) @variable.other.member
|
||||
|
||||
; Literals
|
||||
|
||||
[
|
||||
(double_quote_string_literal)
|
||||
(single_quoted_string_literal)
|
||||
(triple_double_quote_string_literal)
|
||||
(triple_single_quoted_string_literal)
|
||||
] @string
|
||||
|
||||
[
|
||||
(int_literal)
|
||||
(uint_literal)
|
||||
] @constant.numeric.integer
|
||||
(float_literal) @constant.numeric.float
|
||||
|
||||
[
|
||||
(true)
|
||||
(false)
|
||||
] @constant.builtin.boolean
|
||||
|
||||
(null) @constant.builtin
|
||||
|
||||
(comment) @comment
|
@ -0,0 +1,47 @@
|
||||
; highlights.scm
|
||||
|
||||
[
|
||||
"definition"
|
||||
"caveat"
|
||||
"permission"
|
||||
"relation"
|
||||
"nil"
|
||||
] @keyword
|
||||
|
||||
[
|
||||
","
|
||||
":"
|
||||
] @punctuation.delimiter
|
||||
|
||||
[
|
||||
"("
|
||||
")"
|
||||
"{"
|
||||
"}"
|
||||
] @punctuation.bracket
|
||||
|
||||
[
|
||||
"|"
|
||||
"+"
|
||||
"-"
|
||||
"&"
|
||||
"#"
|
||||
"->"
|
||||
"="
|
||||
] @operator
|
||||
("with") @keyword.operator
|
||||
|
||||
[
|
||||
"nil"
|
||||
"*"
|
||||
] @constant.builtin
|
||||
|
||||
(comment) @comment
|
||||
(type_identifier) @type
|
||||
(cel_type_identifier) @type
|
||||
(cel_variable_identifier) @variable.parameter
|
||||
(field_identifier) @variable.other.member
|
||||
[
|
||||
(func_identifier)
|
||||
(method_identifier)
|
||||
] @function.method
|
@ -0,0 +1,5 @@
|
||||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
|
||||
((caveat_expr) @injection.content
|
||||
(#set! injection.language "cel"))
|
@ -0,0 +1,4 @@
|
||||
(object_definition
|
||||
name: (type_identifier) @name) @definition.type
|
||||
|
||||
(type_identifier) @name @reference.type
|
Loading…
Reference in New Issue