-
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.
Get basic syntax highlighting working
This pulls the queries and injections straight from the work done for Helix in [this PR][1], from @zetashift. These should definitely be upstreamed when possible! They also show up a few bugs in the grammar as it stands, e.g. keywords get highlighted in the middle of documentation blocks, where they should be ignored. Still: a start! [1]: helix-editor/helix#7724
- Loading branch information
1 parent
5f11305
commit 54aa5e2
Showing
3 changed files
with
73 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,71 @@ | ||
(kw_forall) @keyword | ||
;; Primitives | ||
(comment) @comment | ||
(nat) @constant.numeric | ||
(unit) @constant.builtin | ||
(literal_char) @constant.character | ||
(literal_text) @string | ||
(literal_boolean) @constant.builtin.boolean | ||
|
||
;; Keywords | ||
[ | ||
(kw_forall) | ||
(unique_kw) | ||
(type_kw) | ||
(kw_equals) | ||
(do) | ||
] @keyword | ||
|
||
(kw_let) @keyword.function | ||
(type_kw) @keyword.storage.type | ||
(unique) @keyword.storage.modifier | ||
("use") @keyword.control.import | ||
|
||
|
||
[ | ||
(type_constructor) | ||
] @constructor | ||
|
||
[ | ||
(operator) | ||
(pipe) | ||
(arrow_symbol) | ||
(">") | ||
(or) | ||
(bang) | ||
] @operator | ||
|
||
[ | ||
"if" | ||
"else" | ||
"then" | ||
(match) | ||
(with) | ||
(cases) | ||
] @keyword.control.conditional | ||
|
||
(blank_pattern) @variable.builtin | ||
|
||
;; Types | ||
(record_field name: (wordy_id) @variable.other.member type: (wordy_id) @type) | ||
[ | ||
(type_name) | ||
(type_signature) | ||
(effect) | ||
] @type | ||
|
||
(term_definition) @variable | ||
|
||
;; Punctuation | ||
[ | ||
(type_signature_colon) | ||
":" | ||
] @punctuation.delimiter | ||
|
||
[ | ||
"(" | ||
")" | ||
"{" | ||
"}" | ||
"[" | ||
"]" | ||
] @punctuation.bracket |
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 @@ | ||
((doc_block) @injection.content (#set! injection.language "markdown")) |
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