fix(editor): detect open-ended dotenv filenames - #13239
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdded 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
mobile/src/session/mobile-file-syntax.test.ts (1)
23-29: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCover case-insensitive dotenv detection in both test suites.
Both implementations lowercase filenames, but neither test suite verifies an uppercase
.ENV.*filename.
mobile/src/session/mobile-file-syntax.test.ts#L23-L29: adddetectMobileFileLanguage('.ENV.STAGING')and expectini.src/renderer/src/lib/language-detect.test.ts#L73-L82: adddetectLanguage('.ENV.STAGING')and expectini.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 7ac69f5a-1e47-474f-9312-2189c3714bd7
📒 Files selected for processing (4)
mobile/src/session/mobile-file-language.tsmobile/src/session/mobile-file-syntax.test.tssrc/renderer/src/lib/language-detect.test.tssrc/renderer/src/lib/language-detect.ts
4309e79 to
d05bcae
Compare
Sync update (
|
Description
Dotenv files with scoped names such as
.env.functions.local,.env.staging, and.env.test.examplenow receive INI syntax highlighting when no more specific language mapping applies.The desktop and mobile filename detectors share the same fallback rule while preserving explicit language extensions and excluding
.envrc.Focused fix
.envand.env.*filenames after exact-name and extension-specific lookups miss..env.sh,.envrc, or other explicitly mapped file types.Preserves
Evidence
pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/language-detect.test.ts mobile/src/session/mobile-file-language.test.ts.envrcexclusion.User-regression-tradeoffs
.env.*files are intentionally treated as dotenv/INI content; a future language-specific extension mapping will continue to take precedence.Fixes #13028