Add static semantic token modifier for associated functions with no &self

This commit is contained in:
Anatol Liu 2020-11-04 20:08:46 -08:00
parent 678a29e938
commit 3baa526fb0
8 changed files with 110 additions and 2 deletions

View file

@ -787,6 +787,10 @@ impl Function {
pub fn has_body(self, db: &dyn HirDatabase) -> bool {
db.function_data(self.id).has_body
}
pub fn source(self, db: &dyn HirDatabase) -> InFile<ast::Fn> {
self.id.lookup(db.upcast()).source(db.upcast())
}
}
// Note: logically, this belongs to `hir_ty`, but we are not using it there yet.