forked from helix-editor/helix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
languages: add CEL, SpiceDB schema language (helix-editor#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 <[email protected]> * languages: update spicedb --------- Co-authored-by: Michael Davis <[email protected]>
- Loading branch information
1 parent
dad2421
commit bb19f55
Showing
6 changed files
with
148 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
((comment) @injection.content | ||
(#set! injection.language "comment")) | ||
|
||
((caveat_expr) @injection.content | ||
(#set! injection.language "cel")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
(object_definition | ||
name: (type_identifier) @name) @definition.type | ||
|
||
(type_identifier) @name @reference.type |