Highlight after special-casing repl snippets

Signed-off-by: Richard Feldman <oss@rtfeldman.com>
This commit is contained in:
Richard Feldman 2024-01-22 23:58:38 -05:00 committed by GitHub
parent e2dac4f022
commit 615975b30a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -14,7 +14,6 @@ pub fn highlight_roc_code_inline(code: &str) -> String {
} }
pub fn highlight(code: &str) -> Vec<String> { pub fn highlight(code: &str) -> Vec<String> {
let locations: Vec<Loc<Token>> = roc_parse::highlight::highlight(code);
let mut buf: Vec<String> = Vec::new(); let mut buf: Vec<String> = Vec::new();
let mut offset = 0; let mut offset = 0;
@ -30,7 +29,7 @@ pub fn highlight(code: &str) -> Vec<String> {
code code
}; };
for location in locations { for location in roc_parse::highlight::highlight(code) {
let current_text = &code[offset..location.byte_range().end]; let current_text = &code[offset..location.byte_range().end];
match location.value { match location.value {