fix cache and imports (#6647)

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix clippy

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2025-05-02 10:41:14 -07:00
committed by GitHub
parent 09ebb517d9
commit ace9a59a45
43 changed files with 4205 additions and 3916 deletions

View File

@ -542,6 +542,16 @@ impl Program {
}
}
/// Checks if the ast has any import statements.
pub fn has_import_statements(&self) -> bool {
for item in &self.body {
if let BodyItem::ImportStatement(_) = item {
return true;
}
}
false
}
pub fn in_comment(&self, pos: usize) -> bool {
// Check if its in the body.
if self.non_code_meta.in_comment(pos) {