aboutsummaryrefslogtreecommitdiff
path: root/crates/hir/src/code_model.rs
diff options
context:
space:
mode:
authorAnatol Liu <[email protected]>2020-11-05 04:08:46 +0000
committerAnatol Liu <[email protected]>2020-11-05 04:08:46 +0000
commit3baa526fb07184ce9804a06c8e0251971eea3b49 (patch)
treef895bdab50f6a839b30da4a4acb7d11a79e83ac3 /crates/hir/src/code_model.rs
parent678a29e938f5833ecbf5a50eee0e29c5d99b56c4 (diff)
Add static semantic token modifier for associated functions with no &self
Diffstat (limited to 'crates/hir/src/code_model.rs')
-rw-r--r--crates/hir/src/code_model.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs
index 30a5e4580..afb849b4d 100644
--- a/crates/hir/src/code_model.rs
+++ b/crates/hir/src/code_model.rs
@@ -787,6 +787,10 @@ impl Function {
787 pub fn has_body(self, db: &dyn HirDatabase) -> bool { 787 pub fn has_body(self, db: &dyn HirDatabase) -> bool {
788 db.function_data(self.id).has_body 788 db.function_data(self.id).has_body
789 } 789 }
790
791 pub fn source(self, db: &dyn HirDatabase) -> InFile<ast::Fn> {
792 self.id.lookup(db.upcast()).source(db.upcast())
793 }
790} 794}
791 795
792// Note: logically, this belongs to `hir_ty`, but we are not using it there yet. 796// Note: logically, this belongs to `hir_ty`, but we are not using it there yet.