Skip to content

Commit cfac2c3

Browse files
committed
add test for &raw const/&raw mut is not syntax-highlighted in all files
1 parent 02cd8c5 commit cfac2c3

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
<style>
3+
body { margin: 0; }
4+
pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padding: 0.4em; }
5+
6+
.lifetime { color: #DFAF8F; font-style: italic; }
7+
.label { color: #DFAF8F; font-style: italic; }
8+
.comment { color: #7F9F7F; }
9+
.documentation { color: #629755; }
10+
.intra_doc_link { font-style: italic; }
11+
.injected { opacity: 0.65 ; }
12+
.struct, .enum { color: #7CB8BB; }
13+
.enum_variant { color: #BDE0F3; }
14+
.string_literal { color: #CC9393; }
15+
.field { color: #94BFF3; }
16+
.function { color: #93E0E3; }
17+
.parameter { color: #94BFF3; }
18+
.text { color: #DCDCCC; }
19+
.type { color: #7CB8BB; }
20+
.builtin_type { color: #8CD0D3; }
21+
.type_param { color: #DFAF8F; }
22+
.attribute { color: #94BFF3; }
23+
.numeric_literal { color: #BFEBBF; }
24+
.bool_literal { color: #BFE6EB; }
25+
.macro { color: #94BFF3; }
26+
.proc_macro { color: #94BFF3; text-decoration: underline; }
27+
.derive { color: #94BFF3; font-style: italic; }
28+
.module { color: #AFD8AF; }
29+
.value_param { color: #DCDCCC; }
30+
.variable { color: #DCDCCC; }
31+
.format_specifier { color: #CC696B; }
32+
.mutable { text-decoration: underline; }
33+
.escape_sequence { color: #94BFF3; }
34+
.keyword { color: #F0DFAF; font-weight: bold; }
35+
.control { font-style: italic; }
36+
.reference { font-style: italic; font-weight: bold; }
37+
.const { font-weight: bolder; }
38+
.unsafe { color: #BC8383; }
39+
40+
.invalid_escape_sequence { color: #FC5555; text-decoration: wavy underline; }
41+
.unresolved_reference { color: #FC5555; text-decoration: wavy underline; }
42+
</style>
43+
<pre><code><span class="keyword">fn</span> <span class="function declaration">main</span><span class="parenthesis">(</span><span class="parenthesis">)</span> <span class="brace">{</span>
44+
<span class="keyword">let</span> <span class="variable declaration">x</span> <span class="operator">=</span> <span class="operator">&</span><span class="keyword">raw</span> <span class="keyword">mut</span> <span class="numeric_literal">5</span><span class="semicolon">;</span>
45+
<span class="brace">}</span>
46+
</code></pre>

Diff for: crates/ide/src/syntax_highlighting/tests.rs

+15
Original file line numberDiff line numberDiff line change
@@ -1420,3 +1420,18 @@ fn template() {}
14201420
false,
14211421
);
14221422
}
1423+
1424+
#[test]
1425+
fn issue_19357() {
1426+
check_highlighting(
1427+
r#"
1428+
//- /foo.rs
1429+
fn main() {
1430+
let x = &raw mut 5;
1431+
}
1432+
//- /main.rs
1433+
"#,
1434+
expect_file!["./test_data/highlight_issue_19357.html"],
1435+
false,
1436+
);
1437+
}

0 commit comments

Comments
 (0)