From 2145e2d878fb3b8ffcaa4ab0858cab3a7a4324e0 Mon Sep 17 00:00:00 2001 From: Leander Tentrup Date: Wed, 17 Jun 2020 15:27:13 +0200 Subject: Syntax highlighting for escape sequences in strings --- crates/ra_ide/src/snapshots/highlight_doctest.html | 1 + crates/ra_ide/src/snapshots/highlight_injection.html | 1 + crates/ra_ide/src/snapshots/highlight_strings.html | 7 ++++++- crates/ra_ide/src/snapshots/highlight_unsafe.html | 1 + crates/ra_ide/src/snapshots/highlighting.html | 1 + crates/ra_ide/src/snapshots/rainbow_highlighting.html | 1 + 6 files changed, 11 insertions(+), 1 deletion(-) (limited to 'crates/ra_ide/src/snapshots') diff --git a/crates/ra_ide/src/snapshots/highlight_doctest.html b/crates/ra_ide/src/snapshots/highlight_doctest.html index 13a5d1b12..f92a0aba5 100644 --- a/crates/ra_ide/src/snapshots/highlight_doctest.html +++ b/crates/ra_ide/src/snapshots/highlight_doctest.html @@ -26,6 +26,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd .format_specifier { color: #CC696B; } .mutable { text-decoration: underline; } .unresolved_reference { color: #FC5555; } +.escape_sequence { color: #94BFF3; } .keyword { color: #F0DFAF; font-weight: bold; } .keyword.unsafe { color: #BC8383; font-weight: bold; } diff --git a/crates/ra_ide/src/snapshots/highlight_injection.html b/crates/ra_ide/src/snapshots/highlight_injection.html index e1c9d3523..47dbd7bc8 100644 --- a/crates/ra_ide/src/snapshots/highlight_injection.html +++ b/crates/ra_ide/src/snapshots/highlight_injection.html @@ -26,6 +26,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd .format_specifier { color: #CC696B; } .mutable { text-decoration: underline; } .unresolved_reference { color: #FC5555; } +.escape_sequence { color: #94BFF3; } .keyword { color: #F0DFAF; font-weight: bold; } .keyword.unsafe { color: #BC8383; font-weight: bold; } diff --git a/crates/ra_ide/src/snapshots/highlight_strings.html b/crates/ra_ide/src/snapshots/highlight_strings.html index 666b48fd0..b46fa44c6 100644 --- a/crates/ra_ide/src/snapshots/highlight_strings.html +++ b/crates/ra_ide/src/snapshots/highlight_strings.html @@ -26,6 +26,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd .format_specifier { color: #CC696B; } .mutable { text-decoration: underline; } .unresolved_reference { color: #FC5555; } +.escape_sequence { color: #94BFF3; } .keyword { color: #F0DFAF; font-weight: bold; } .keyword.unsafe { color: #BC8383; font-weight: bold; } @@ -83,6 +84,10 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd println!(r"Hello, {}!", "world"); - println!("{\x41}", A = 92); + // escape sequences + println!("Hello\nWorld"); + println!("\u{48}\x65\x6C\x6C\x6F World"); + + println!("{\x41}", A = 92); println!("{ничоси}", ничоси = 92); } \ No newline at end of file diff --git a/crates/ra_ide/src/snapshots/highlight_unsafe.html b/crates/ra_ide/src/snapshots/highlight_unsafe.html index e1540499b..73438fbb4 100644 --- a/crates/ra_ide/src/snapshots/highlight_unsafe.html +++ b/crates/ra_ide/src/snapshots/highlight_unsafe.html @@ -26,6 +26,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd .format_specifier { color: #CC696B; } .mutable { text-decoration: underline; } .unresolved_reference { color: #FC5555; } +.escape_sequence { color: #94BFF3; } .keyword { color: #F0DFAF; font-weight: bold; } .keyword.unsafe { color: #BC8383; font-weight: bold; } diff --git a/crates/ra_ide/src/snapshots/highlighting.html b/crates/ra_ide/src/snapshots/highlighting.html index 52912dc93..0c4f0a018 100644 --- a/crates/ra_ide/src/snapshots/highlighting.html +++ b/crates/ra_ide/src/snapshots/highlighting.html @@ -26,6 +26,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd .format_specifier { color: #CC696B; } .mutable { text-decoration: underline; } .unresolved_reference { color: #FC5555; } +.escape_sequence { color: #94BFF3; } .keyword { color: #F0DFAF; font-weight: bold; } .keyword.unsafe { color: #BC8383; font-weight: bold; } diff --git a/crates/ra_ide/src/snapshots/rainbow_highlighting.html b/crates/ra_ide/src/snapshots/rainbow_highlighting.html index 1d7f04882..a74a70069 100644 --- a/crates/ra_ide/src/snapshots/rainbow_highlighting.html +++ b/crates/ra_ide/src/snapshots/rainbow_highlighting.html @@ -26,6 +26,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd .format_specifier { color: #CC696B; } .mutable { text-decoration: underline; } .unresolved_reference { color: #FC5555; } +.escape_sequence { color: #94BFF3; } .keyword { color: #F0DFAF; font-weight: bold; } .keyword.unsafe { color: #BC8383; font-weight: bold; } -- cgit v1.2.3