Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/has_source.rs')
-rw-r--r--crates/hir/src/has_source.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/hir/src/has_source.rs b/crates/hir/src/has_source.rs
index a3f4a65513..8669b00ca1 100644
--- a/crates/hir/src/has_source.rs
+++ b/crates/hir/src/has_source.rs
@@ -16,6 +16,9 @@ use crate::{
pub trait HasSource {
type Ast;
+ /// Fetches the definition's source node.
+ /// Using [`crate::Semantics::source`] is preferred when working with [`crate::Semantics`],
+ /// as that caches the parsed file in the semantics' cache.
fn source(self, db: &dyn HirDatabase) -> Option<InFile<Self::Ast>>;
}