Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/base-db/src/lib.rs')
-rw-r--r--crates/base-db/src/lib.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/base-db/src/lib.rs b/crates/base-db/src/lib.rs
index a209a0e631..ff439119c9 100644
--- a/crates/base-db/src/lib.rs
+++ b/crates/base-db/src/lib.rs
@@ -7,6 +7,7 @@ extern crate rustc_driver as _;
pub use salsa;
pub use salsa_macros;
+use span::TextSize;
// FIXME: Rename this crate, base db is non descriptive
mod change;
@@ -49,6 +50,7 @@ macro_rules! impl_intern_key {
#[salsa_macros::interned(no_lifetime, revisions = usize::MAX)]
#[derive(PartialOrd, Ord)]
pub struct $id {
+ #[returns(ref)]
pub loc: $loc,
}
@@ -280,6 +282,8 @@ pub trait SourceDatabase: salsa::Database {
fn crates_map(&self) -> Arc<CratesMap>;
fn nonce_and_revision(&self) -> (Nonce, salsa::Revision);
+
+ fn line_column(&self, file: FileId, offset: TextSize) -> Result<(u32, u32), ()>;
}
static NEXT_NONCE: AtomicUsize = AtomicUsize::new(0);