mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Ensure resolved hint's file exists
This commit is contained in:
parent
10464c7c42
commit
caf018507a
3 changed files with 11 additions and 0 deletions
|
@ -184,6 +184,11 @@ impl Vfs {
|
|||
mem::take(&mut self.changes)
|
||||
}
|
||||
|
||||
/// Provides a panic-less way to verify file_id validity.
|
||||
pub fn exists(&self, file_id: FileId) -> bool {
|
||||
self.get(file_id).is_some()
|
||||
}
|
||||
|
||||
/// Returns the id associated with `path`
|
||||
///
|
||||
/// - If `path` does not exists in the `Vfs`, allocate a new id for it, associated with a
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue