diff --git a/crates/file_icons/src/file_icons.rs b/crates/file_icons/src/file_icons.rs index 88b2003635..37b0a6b225 100644 --- a/crates/file_icons/src/file_icons.rs +++ b/crates/file_icons/src/file_icons.rs @@ -54,7 +54,7 @@ impl FileIcons { // check if file name is in suffixes // e.g. catch file named `eslint.config.js` instead of `.eslint.config.js` - if let Some(typ) = path.to_str().and_then(|typ| this.suffixes.get(typ)) { + if let Some(typ) = path.file_name().and_then(|typ| typ.to_str()) { let maybe_path = get_icon_from_suffix(typ); if maybe_path.is_some() { return maybe_path;