Skip to content

Commit 44404e4

Browse files
committed
added docstring
1 parent 78bb458 commit 44404e4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

crates/base-db/src/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,15 @@ impl Files {
141141
};
142142
}
143143

144+
/// - `None` may occur if the
145+
/// [`FileId`](https://docs.rs/ra_ap_vfs/latest/ra_ap_vfs/struct.FileId.html)
146+
/// has been loaded into the VFS but was not registered with the
147+
/// [`ra_ap_base_db::RootDatabase`](https://docs.rs/ra_ap_ide_db/latest/ra_ap_ide_db/struct.RootDatabase.html).
148+
/// - See [rust-analyzer#20676](https://github.com/rust-lang/rust-analyzer/issues/20676)
149+
/// for details and reproduction steps.
150+
///
151+
/// To ensure proper registration, use
152+
/// [`ra_ap_load_cargo::load_workspace()`](https://docs.rs/ra_ap_load-cargo/latest/ra_ap_load_cargo/fn.load_workspace.html).
144153
pub fn file_source_root(&self, id: vfs::FileId) -> FileSourceRootInput {
145154
let file_source_root = match self.file_source_roots.get(&id) {
146155
Some(file_source_root) => file_source_root,
@@ -151,6 +160,7 @@ impl Files {
151160
*file_source_root
152161
}
153162

163+
154164
pub fn set_file_source_root_with_durability(
155165
&self,
156166
db: &mut dyn SourceDatabase,

0 commit comments

Comments
 (0)