afd0da97b930c1cf07698c6fdd970dacf649c5a4
This PR fixes a rare case where icons could be missing in the language selector. Currently, whilst looking up an icon, all file suffixes starting with a dot are filtered out. While this works fine for some languages, there are some languages having only file suffixes starting with a dot, e.g. the "Git Attributes" language provided from the "Git Firefly" extension. This results in no icon being displayed in the list, as shown in the screenshots below. To solve this, we can just simply remove the check for this special case as well as the construction of an artificial file name in the code, as both are not needed. A simple path just consisting of the extension is sufficient, as we currently do not differentiate between file names and file suffixes during an icon lookup. see the relevant code below:013a646799/crates/file_icons/src/file_icons.rs (L23-L52)As the first lookup is directly done using the entire file name and then checked against all suffixes, we actually do not have to construct an artificial file name at all. Should that produce no match, we check for a hidden file right after, so we do not have to filter hidden file names out. With this fix, nothing changes for "normal" file suffixes, for some cases where languges provide entire file names as a path suffix, the matching might improve, and for languages with only hidden associated file names, the initially described issue is resolved. I do believe the behavior of matching icons to languages could be improved in general. Fowever, I do think this is beyond the scope of this change. | Current main | <img width="546" alt="main" src="https://github.com/user-attachments/assets/5c3c9fdc-cadf-4e44-9667-2530374aa0d2" /> | | --- | --- | | This PR |<img width="546" alt="PR" src="https://github.com/user-attachments/assets/82e59108-e31f-4ca9-8bbd-b9fd2b34feb0" />| Aditionally, in4395f78fb2I refactored the code which acquires the label and icon for a match, since I found it a bit hard to read initially. The majority of this diff comes from this change. Should that not be wanted, I can revert that change. Release Notes: - Fixed a rare case where languages had no associated icon in the language selector.
Zed
Welcome to Zed, a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Installation
On macOS and Linux you can download Zed directly or install Zed via your local package manager.
Other platforms are not yet available:
- Windows (tracking issue)
- Web (tracking issue)
Developing Zed
- Building Zed for macOS
- Building Zed for Linux
- Building Zed for Windows
- Running Collaboration Locally
Contributing
See CONTRIBUTING.md for ways you can contribute to Zed.
Also... we're hiring! Check out our jobs page for open roles.
Licensing
License information for third party dependencies must be correctly provided for CI to pass.
We use cargo-about to automatically comply with open source licenses. If CI is failing, check the following:
- Is it showing a
no license specifiederror for a crate you've created? If so, addpublish = falseunder[package]in your crate's Cargo.toml. - Is the error
failed to satisfy license requirementsfor a dependency? If so, first determine what license the project has and whether this system is sufficient to comply with this license's requirements. If you're unsure, ask a lawyer. Once you've verified that this system is acceptable add the license's SPDX identifier to theacceptedarray inscript/licenses/zed-licenses.toml. - Is
cargo-aboutunable to find the license for a dependency? If so, add a clarification field at the end ofscript/licenses/zed-licenses.toml, as specified in the cargo-about book.
Description
Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Readme
586 MiB
Languages
Rust
94.7%
JSON-with-Comments
3.1%
Inno Setup
0.6%
Scheme
0.5%
Shell
0.3%
Other
0.4%