diff --git a/src/database.rs b/src/database.rs index 9a437a3..dd72b5a 100644 --- a/src/database.rs +++ b/src/database.rs @@ -717,6 +717,13 @@ impl Database { self.parse_result().statement(addr) } + /// Get the name of the source file for a given statement. + #[inline] + #[must_use] + pub fn statement_source_name(&self, addr: StatementAddress) -> &str { + &self.parse_result().source_info(addr.segment_id).name + } + /// Iterates over all the statements #[must_use] pub fn statements(&self) -> impl DoubleEndedIterator> + Clone + '_ {