diff --git a/crates/ide/src/syntax_highlighting/test_data/highlight_const.html b/crates/ide/src/syntax_highlighting/test_data/highlight_const.html new file mode 100644 index 0000000000..cd6ffc2c3a --- /dev/null +++ b/crates/ide/src/syntax_highlighting/test_data/highlight_const.html @@ -0,0 +1,83 @@ + + +
macro_rules! id {
+ ($($tt:tt)*) => {
+ $($tt)*
+ };
+}
+const CONST_ITEM: *const () = &raw const ();
+const fn const_fn<const CONST_PARAM: ()>(const {}: const fn()) where (): const ConstTrait {
+ CONST_ITEM;
+ CONST_PARAM;
+ const {
+ const || {}
+ }
+ id!(
+ CONST_ITEM;
+ CONST_PARAM;
+ const {
+ const || {}
+ };
+ &raw const ();
+ const
+ );
+}
+trait ConstTrait {
+ const ASSOC_CONST: () = ();
+ const fn assoc_const_fn() {}
+}
+impl const ConstTrait for () {
+ const ASSOC_CONST: () = ();
+ const fn assoc_const_fn() {}
+}
+
+macro_rules! unsafe_deref {
+ () => {
+ *(&() as *const ())
+ };
+}
\ 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 a2bec3dbd2..f4a9623fc8 100644
--- a/crates/ide/src/syntax_highlighting/tests.rs
+++ b/crates/ide/src/syntax_highlighting/tests.rs
@@ -1219,7 +1219,9 @@ fn benchmark_syntax_highlighting_parser() {
.highlight(HL_CONFIG, file_id)
.unwrap()
.iter()
- .filter(|it| it.highlight.tag == HlTag::Symbol(SymbolKind::Function))
+ .filter(|it| {
+ matches!(it.highlight.tag, HlTag::Symbol(SymbolKind::Function | SymbolKind::Method))
+ })
.count()
};
assert_eq!(hash, 1169);