grammars: Stop treating fish modelines as Shell Script (#58550)

Bash listed `fish` in `modeline_aliases`, so a `filetype=fish` modeline
resolved to Shell Script before the real [Fish
language](https://zed.dev/extensions/fish) could match by name or
grammar. Fish is intentionally non-POSIX, so the Bash grammar is the
wrong fit here.

| Header | After |
|--------|--------|
| <img width="1912" height="1237" alt="image"
src="https://github.com/user-attachments/assets/ed212a24-92aa-4ede-a432-47c6c6724f08"
/> | <img width="1732" height="1125" alt="image"
src="https://github.com/user-attachments/assets/934140b3-9473-4cca-a3e5-84aa3c4d827a"
/> |

Self-Review Checklist:

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

Closes #58532.

Release Notes:

- Dropped `fish` from `modeline_aliases` which forced the file to be
detected as Shell Script instead of Fish
This commit is contained in:
Kunall Banerjee authored and GitHub committed 2026-06-04 21:48:52 +00:00
1 parent 6c631bc5e1
commit 5b864275f2
1 file changed
+1 -1
+1 -1
View File
@@ -2,7 +2,7 @@ name = "Shell Script"
code_fence_block_name = "bash"
grammar = "bash"
path_suffixes = ["sh", "bash", "bashrc", "bash_profile", "bash_aliases", "bash_logout", "bats", "profile", "zsh", "zshrc", "zshenv", "zsh_profile", "zsh_aliases", "zsh_histfile", "zlogin", "zprofile", ".env", "PKGBUILD", "APKBUILD"]
modeline_aliases = ["sh", "shell", "shell-script", "zsh", "fish"]
modeline_aliases = ["sh", "shell", "shell-script", "zsh"]
line_comments = ["# "]
first_line_pattern = '^#!.*\b(?:ash|bash|bats|dash|sh|zsh)\b'
autoclose_before = "}])"