Move ws insert rendering for macro expansion into ide_db

This commit is contained in:
Lukas Wirth 2021-12-13 15:55:13 +01:00
parent d03397fe11
commit 328419534d
10 changed files with 139 additions and 95 deletions

View file

@ -1163,9 +1163,12 @@ impl<'a> SemanticsScope<'a> {
Some(Crate { id: self.resolver.krate()? })
}
pub fn in_macro_file(&self) -> bool {
self.file_id.is_macro()
}
/// Note: `FxHashSet<TraitId>` should be treated as an opaque type, passed into `Type
// FIXME: rename to visible_traits to not repeat scope?
pub fn traits_in_scope(&self) -> FxHashSet<TraitId> {
pub fn visible_traits(&self) -> FxHashSet<TraitId> {
let resolver = &self.resolver;
resolver.traits_in_scope(self.db.upcast())
}