Add public semantic token modifier for public items

This commit is contained in:
Aramis Razzaghipour 2021-05-28 09:25:32 +10:00
parent 3762cb4535
commit 3e7472f76c
No known key found for this signature in database
GPG key ID: F788F7E990136003
9 changed files with 67 additions and 35 deletions

View file

@ -242,6 +242,14 @@ fn use_foo_items() {
}
}
pub enum Bool { True, False }
impl Bool {
pub const fn to_primitive(self) -> bool {
matches!(self, Self::True)
}
}
const USAGE_OF_BOOL:bool = Bool::True.to_primitive();
//- /foo.rs crate:foo
pub struct Person {
@ -390,7 +398,7 @@ struct Foo {
.highlight_range(FileRange { file_id, range: TextRange::at(45.into(), 1.into()) })
.unwrap();
assert_eq!(&highlights[0].highlight.to_string(), "field.declaration");
assert_eq!(&highlights[0].highlight.to_string(), "field.declaration.public");
}
#[test]