grammars: Recognize Gentoo ebuild files as bash script (#59068)

The Gentoo `ebuild` file format is a subset of a bash script, see
https://wiki.gentoo.org/wiki/Ebuild.


Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #ISSUE

Release Notes:

- Changed `ebuild` files to be recognized as bash.

Signed-off-by: gcarq <egger.m@protonmail.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
This commit is contained in:
Michael EggerandKirill Bulatov authored and GitHub committed 2026-07-08 12:36:29 +00:00
1 parent b099024705
commit ce9720d61b
2 files changed
+6 -1

No files matched your search

@@ -514,6 +514,11 @@ mod tests {
detect_language(".env", &map),
Some("Shell Script".to_string())
);
// Gentoo ebuild files are a subset of bash
assert_eq!(
detect_language("app-editors/zed-1.5.4.ebuild", &map),
Some("Shell Script".to_string())
);
}
#[test]
+1 -1
View File
@@ -1,7 +1,7 @@
name = "Shell Script"
code_fence_block_name = "bash"
grammar = "bash"
path_suffixes = ["sh", "bash", "bashrc", "bash_profile", "bash_aliases", "bash_logout", "bats", "envrc", "profile", "zsh", "zshrc", "zshenv", "zsh_profile", "zsh_aliases", "zsh_histfile", "zlogin", "zprofile", ".env", "PKGBUILD", "APKBUILD"]
path_suffixes = ["sh", "bash", "bashrc", "bash_profile", "bash_aliases", "bash_logout", "bats", "envrc", "profile", "zsh", "zshrc", "zshenv", "zsh_profile", "zsh_aliases", "zsh_histfile", "zlogin", "zprofile", ".env", "PKGBUILD", "APKBUILD", "ebuild"]
modeline_aliases = ["sh", "shell", "shell-script", "zsh"]
line_comments = ["# "]
first_line_pattern = '^#!.*\b(?:ash|bash|bats|dash|sh|zsh)\b'