Recognize .command files as shell scripts#9345
Recognize .command files as shell scripts#9345anshul-garg27 wants to merge 1 commit intowarpdotdev:masterfrom
Conversation
|
I'm starting a first review of this pull request. You can follow along in the session on Warp. I approved this pull request and requested human review from: @vorporeal, @alokedesai, @zachbai. Comment I approved this pull request. No matching stakeholder was found for the changed files, so no human reviewers were requested. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR maps .command files to the existing shell language support and adds a focused regression test for filename-based detection.
Concerns
- None identified.
Verdict
Found: 0 critical, 0 important, 0 suggestions
Approve
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
There was a problem hiding this comment.
Overview
This PR updates the language extension mapping so .command files resolve to the existing Shell language support, and adds a focused regression test for language_by_filename(Path::new("script.command")).
Concerns
- No blocking correctness or security concerns found in the changed lines.
Verdict
Found: 0 critical, 0 important, 0 suggestions
Approve
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
Description
Fixes #9213. On macOS,
.commandis the standard extension for double-clickable shell scripts (a#!/usr/bin/env bashfile you canchmod +xand run from Finder). Opening one in Warp's editor today shows "Language support is unavailable for this file type" becauselanguage_by_filenameincrates/languages/src/lib.rsdoesn't includecommandnext to the existingsh | zsh | bashshell extensions.Testing
command_extension_resolves_to_shellincrates/languages/src/lib_tests.rsthat callslanguage_by_filename(Path::new("script.command"))and asserts the returned language'sdisplay_nameis"Shell"— fails on master, passes after the fix.cargo fmt -p languages -- --checkpasses locally.cargo nextest run -p languageslocally because the Metal toolchain isn't installed (same situation as Expand~inwarp://action/new_tab?path=URLs #9277), so relying on CI for the full clippy / nextest pass.Changelog Entries for Stable
CHANGELOG-BUG-FIX:
.commandshell scripts now open with shell syntax highlighting in Warp's editor.