aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/syntax_highlighting/tests.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-06-23 00:58:59 +0100
committerGitHub <[email protected]>2021-06-23 00:58:59 +0100
commit3381c2e4a8bcea2db3edd1741a7dd3fcdb15231b (patch)
treefc99fe5bc5ff7d6826303d166cb911b63125f33d /crates/ide/src/syntax_highlighting/tests.rs
parent3762cb4535dce9eaf7c3dbd4aa9c33bf6dd30c87 (diff)
parent3e7472f76c70c3b0a31bb72f6f318c1aa1aba83d (diff)
Merge #9031
9031: Add `public` semantic token modifier for public items r=Veykril a=arzg Closes #8943. Co-authored-by: Aramis Razzaghipour <[email protected]>
Diffstat (limited to 'crates/ide/src/syntax_highlighting/tests.rs')
-rw-r--r--crates/ide/src/syntax_highlighting/tests.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/crates/ide/src/syntax_highlighting/tests.rs b/crates/ide/src/syntax_highlighting/tests.rs
index 4f0b1ce85..502a88af2 100644
--- a/crates/ide/src/syntax_highlighting/tests.rs
+++ b/crates/ide/src/syntax_highlighting/tests.rs
@@ -242,6 +242,14 @@ fn use_foo_items() {
242 } 242 }
243} 243}
244 244
245pub enum Bool { True, False }
246
247impl Bool {
248 pub const fn to_primitive(self) -> bool {
249 matches!(self, Self::True)
250 }
251}
252const USAGE_OF_BOOL:bool = Bool::True.to_primitive();
245 253
246//- /foo.rs crate:foo 254//- /foo.rs crate:foo
247pub struct Person { 255pub struct Person {
@@ -390,7 +398,7 @@ struct Foo {
390 .highlight_range(FileRange { file_id, range: TextRange::at(45.into(), 1.into()) }) 398 .highlight_range(FileRange { file_id, range: TextRange::at(45.into(), 1.into()) })
391 .unwrap(); 399 .unwrap();
392 400
393 assert_eq!(&highlights[0].highlight.to_string(), "field.declaration"); 401 assert_eq!(&highlights[0].highlight.to_string(), "field.declaration.public");
394} 402}
395 403
396#[test] 404#[test]