Repository navigation
Conversation
📝 WalkthroughWalkthroughLanguage detection now recognizes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
Greptile SummaryThis PR adds syntax highlighting support for Terraform variable files (
Confidence Score: 5/5Safe to merge — the change is additive map entries and one alias; no existing detection paths are modified. All five files touch only lookup tables and one alias entry. The new entries are consistent with the patterns already in both clients, the mobile HCL-to-INI alias correctly routes through resolveMobileSyntaxLanguage before reaching the grammar check, and the tests cover Unix paths, Windows paths, uppercase extensions, and end-to-end grammar application. No runtime behavior outside syntax highlighting is affected. Files Needing Attention: No files require special attention.
|
| Filename | Overview |
|---|---|
| src/renderer/src/lib/language-detect.ts | Adds .tfvars → hcl to EXT_TO_LANGUAGE and four canonical Justfile names → shell to FILENAME_TO_LANGUAGE; logic is straightforward and consistent with existing patterns. |
| mobile/src/session/mobile-file-language.ts | Mirrors the desktop changes — .tfvars added to EXT_TO_LANGUAGE and the four Justfile names added to FILENAME_TO_LANGUAGE; parity with desktop is maintained. |
| mobile/src/session/mobile-file-syntax.ts | Adds hcl: 'ini' alias so that .tfvars files are routed to the bundled INI grammar instead of plaintext; alias placement and lookup order are correct. |
| src/renderer/src/lib/language-detect.test.ts | Adds two new test cases for .tfvars (including Windows uppercase path) and all four Justfile name variants; covers both Unix and Windows separators. |
| mobile/src/session/mobile-file-syntax.test.ts | Adds detection and grammar-resolution tests for .tfvars and Justfiles, including end-to-end highlightMobileCode assertions that verify INI and Bash grammars are actually applied. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[filePath input] --> B[split on / or backslash, extract filename]
B --> C{filename in FILENAME_TO_LANGUAGE?}
C -- yes --> D[return language e.g. justfile/Justfile/.justfile/.just → shell]
C -- no --> E[extname filename lowercase]
E --> F{ext in EXT_TO_LANGUAGE?}
F -- yes --> G[return language e.g. .tfvars → hcl]
F -- no --> H[return plaintext]
subgraph Mobile extra step
G --> I{language in LANGUAGE_ALIASES?}
I -- hcl --> J[ini grammar]
I -- shell --> K[bash grammar]
I -- not found --> L{lowlight.registered?}
L -- yes --> M[use detected grammar]
L -- no --> N[plaintext]
end
Reviews (3): Last reviewed commit: "fix(editor): highlight Justfiles and Ter..." | Re-trigger Greptile
3554be2 to
ac913a8
Compare
ac913a8 to
726be2a
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
Closing as part of fork PR backlog cleanup. This branch is long-conflicted (DIRTY) against current |
Summary
justfileand*.tfvarscurrently render as plaintext in the file preview on desktop and mobile. This maps them to shell and HCL..tfvarsfiles as HCL in desktop and mobile file previews.justfile,Justfile,.justfile, and.justas shell syntax on both clients.Closes #11215
Screenshots
No visual change.
Testing
pnpm lintpnpm typecheckpnpm test— under the required Node 24 runtime, 39,603 tests passed and 64 skipped; one SSH system-transport integration test failed only in the full concurrent suite and passed 3/3 when rerun alone (pre-existing and unrelated: this diff touches only language-detection lookup tables, no transport code)pnpm build— desktop, web, relay, CLI, and both macOS Swift architecture builds completed; the final universal-binary step failed becauselipocould not find the architecture outputs at its expected paths (pre-existing: that step lives inconfig/scripts/build-computer-macos.mjs, which is unchanged onmainand untouched by this PR)cd mobile && ./node_modules/.bin/vitest run --config vitest.config.ts— 352 files passed; 2,597 tests passed and 2 skippedcd mobile && ./node_modules/.bin/tsc --noEmitcd mobile && ./node_modules/.bin/oxlint src app.tfvars, grammar resolution, and semantic token outputAI Review Report
The review traced both runtime paths before choosing language IDs. Monaco 0.55.1 bundles HCL and shell but not Makefile; mobile lowlight bundles INI, Makefile, and Bash but not HCL. The implementation therefore uses native HCL on desktop, shell for Justfiles on both clients, and the existing INI grammar as the mobile HCL fallback.
Cross-platform review covered macOS, Linux, and Windows path separators and extension casing. The change does not touch shortcuts, labels, shell execution, Electron platform behavior, SSH transport, git providers, agents, or integrations. Lookups remain constant-time map accesses, and there is no meaningful performance risk or UI layout change.
CodeRabbit and Greptile both reviewed the branch and raised no actionable findings.
Security Audit
The change adds no dependency, command execution, filesystem access, IPC, authentication, secret handling, or network surface. File paths are used only for in-memory filename and extension matching; no path is opened or executed by the new logic.
Notes