mirror of
https://github.com/zed-industries/zed.git
synced 2026-11-19 06:59:22 +01:00
cad56bd65a
# Objective Closes #58584. `.env` files are classified as Shell Script, so Zed runs `bash-language-server` on them and `shellcheck` [reports SC2034 on every line](https://github.com/zed-industries/zed/issues/58584#issuecomment-4625839715). ## Solution Add an `Env` language that reuses the Bash grammar and registers no LSP adapters, so highlighting stays and no language server starts. `.envrc` remains Shell Script, since direnv executes it as shell. #7124 mapped `.env` to Shell Script for highlighting and `redactions.scm`, not for linting. `Env` keeps both and only drops the language server. ## Testing - By hand on Windows with `shellcheck` on `PATH`: a `.env` reports 18 SC2034 warnings before and none after. - Unit test covers the `.env` / `.envrc` / `.sh` classification. ## Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [ ] 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 ## Showcase <details> <summary>Click to view showcase</summary> <img width="811" height="841" alt="Group 1" src="https://github.com/user-attachments/assets/fe05e884-e915-420d-a0ba-4075fef8a3d3" /> </details> --- Release Notes: - Fixed `.env` files being treated as shell scripts, which made `shellcheck` report SC2034 on every line. ".env" files now use a separate Env language.