file_icons: Add support for multiple file extensions (#36342)
Currently most icon theme extensions already support file types like stories.tsx and stories.svelte. However within Zed itself these file type overrides are not supported yet. This change adds support for those Release Notes: - Added support for icons on file extensions such as stories.tsx and stories.svelte
This commit is contained in:
@@ -52,6 +52,15 @@ impl FileIcons {
|
||||
}
|
||||
}
|
||||
|
||||
// handle cases where the file extension is made up of multiple important
|
||||
// parts (e.g Component.stories.tsx) that refer to an alternative icon style
|
||||
if let Some(suffix) = path.multiple_extensions() {
|
||||
let maybe_path = get_icon_from_suffix(suffix.as_str());
|
||||
if maybe_path.is_some() {
|
||||
return maybe_path;
|
||||
}
|
||||
}
|
||||
|
||||
// primary case: check if the files extension or the hidden file name
|
||||
// matches some icon path
|
||||
if let Some(suffix) = path.extension_or_hidden_file_name() {
|
||||
|
||||
Reference in New Issue
Block a user