From b1d9f0cc98de7c4cc052d3212a087dbb90ec7c5e 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 +++++++++++++++++++ .../ide/src/syntax_highlighting/tests.rs | 15 ++++++ 2 files changed, 61 insertions(+) create mode 100644 src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/test_data/highlight_issue_19357.html diff --git a/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/test_data/highlight_issue_19357.html b/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/test_data/highlight_issue_19357.html new file mode 100644 index 000000000000..36ed8c594f7e --- /dev/null +++ b/src/tools/rust-analyzer/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/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/tests.rs b/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/tests.rs index 4b3fec1d2f7c..59f2b90333d3 100644 --- a/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/tests.rs +++ b/src/tools/rust-analyzer/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, + ); +}