ZIm/crates/file_icons
Finn Evers ffcad71bfa
file_icons: Resolve icon properly for exact file name match (#24396)
Follow-up to #24391 

The current approach has two issues:
- For the described case of `eslint.config.js`, for which a mapping
exists in `suffixes`, this would get mapped from `eslint.config.js` to
`eslint`. However, for `eslint`, there is no mapping within `suffixes`,
thus currently `get_icon_from_suffix` would return `None` and a wrong
item would be returned at a later step.
- Paths passed to this method are relative to the worktree root, thus
e.g. `eslint.config.js` files in subdirectories would still be assigned
the wrong icon.

---

Behaviour on `main`:
<img width="281" alt="main"
src="https://github.com/user-attachments/assets/19b5e5f8-e413-4ac9-a0a1-2c72f810aa86"
/>

Behaviour with this change:
<img width="299" alt="pr"
src="https://github.com/user-attachments/assets/eec70cbd-df39-49b4-8b07-d22afa949781"
/>

CC @probably-neb 

Release Notes:

- N/A
2025-02-06 17:14:39 -06:00
..
src file_icons: Resolve icon properly for exact file name match (#24396) 2025-02-06 17:14:39 -06:00
Cargo.toml chore: Use workspace fields for edition and publish (#23291) 2025-01-17 17:39:22 +01:00
LICENSE-GPL file_icons: Add license file (#10128) 2024-04-03 12:07:53 -04:00