From cfac2c35ddbd16c528ec8d3be34efd0ccb5f15c3 Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Fri, 21 Mar 2025 20:57:21 +0530 Subject: [PATCH] add test for &raw const/&raw mut is not syntax-highlighted in all files --- .../test_data/highlight_issue_19357.html | 46 +++++++++++++++++++ crates/ide/src/syntax_highlighting/tests.rs | 15 ++++++ 2 files changed, 61 insertions(+) create mode 100644 crates/ide/src/syntax_highlighting/test_data/highlight_issue_19357.html diff --git a/crates/ide/src/syntax_highlighting/test_data/highlight_issue_19357.html b/crates/ide/src/syntax_highlighting/test_data/highlight_issue_19357.html new file mode 100644 index 0000000000..36ed8c594f --- /dev/null +++ b/crates/ide/src/syntax_highlighting/test_data/highlight_issue_19357.html @@ -0,0 +1,46 @@ + + +
fn main() {
+    let x = &raw mut 5;
+}
+
\ No newline at end of file diff --git a/crates/ide/src/syntax_highlighting/tests.rs b/crates/ide/src/syntax_highlighting/tests.rs index 4b3fec1d2f..59f2b90333 100644 --- a/crates/ide/src/syntax_highlighting/tests.rs +++ b/crates/ide/src/syntax_highlighting/tests.rs @@ -1420,3 +1420,18 @@ fn template() {} false, ); } + +#[test] +fn issue_19357() { + check_highlighting( + r#" +//- /foo.rs +fn main() { + let x = &raw mut 5; +} +//- /main.rs +"#, + expect_file!["./test_data/highlight_issue_19357.html"], + false, + ); +}