fix(highlighting): restore TypeScript and Markdown syntax styles - #174
Merged
Conversation
Greptile SummaryThis PR restores complete TypeScript and TSX highlighting by composing the JavaScript, JSX, and TypeScript queries, and replaces Markdown’s line-by-line inline highlighting pass with block-owned injections that preserve code-block styling and multiline prose context.
Confidence Score: 5/5The current PR appears safe to merge, with no actionable correctness, security, or repository-rule violations identified. The composed language queries restore ordinary TypeScript and TSX categories, while Markdown injections preserve block ownership and avoid interpreting fenced or indented code as prose; focused highlighter and renderer regressions cover the affected behavior.
|
| Filename | Overview |
|---|---|
| src/highlighter.rs | Composes complete TypeScript/TSX highlight queries, moves Markdown inline handling into block-scoped injections, and adds focused regression coverage. |
| src/renderer.rs | Adds a retained-frame regression test proving that Markdown-fenced Rust strings keep their rendered string style. |
| docs/issues/162-plan.md | Documents the highlighting failure modes, implementation approach, scope, and verification criteria. |
| docs/roadmap.md | Updates roadmap status and records the disposition of superseded layout tickets. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Document and file extension] --> B{Language}
B -->|TypeScript| C[JavaScript query]
C --> D[TypeScript supplemental query]
B -->|TSX| E[JavaScript query]
E --> F[JSX query]
F --> G[TypeScript supplemental query]
B -->|Markdown| H[Markdown block parser]
H --> I[Inject markdown_inline into prose and table cells]
H --> J[Inject fenced language into code content]
D --> K[Highlight spans]
G --> K
I --> K
J --> K
K --> L[Renderer styles]
Reviews (2): Last reviewed commit: "fix(highlighting): restore TypeScript an..." | Re-trigger Greptile
This was referenced Sep 8, 2026
owainlewis
force-pushed
the
codex/issue-162-highlighting
branch
from
September 8, 2026 16:49
cd66d0f to
2f87670
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TypeScript and TSX now highlight ordinary JavaScript tokens, with JSX styles taking precedence over general identifiers.
Markdown inline formatting is parsed only in prose and table cells, so emphasis-looking text inside fenced or indented code retains its code style.
Why
TypeScript previously configured only the supplemental grammar query, leaving common tokens uncoloured.
Markdown's extra line-by-line inline pass reinterpreted source inside fences and could not retain multiline emphasis context.
Use complete language query composition and block-owned Markdown injections, removing the redundant parser pass.
Test plan
cargo fmt --check,git diff --check,cargo clippy --all-targets -- -D warnings, andcargo build --releasepass..ts,.tsx, and.md: truecolor/string styles, edit/undo, clean exit, preserved files, restored terminal settings, and a usable shell.cargo testpassed its unit-test phase. A serial terminal-suite rerun passed 8/10 tests; the two existing redirected-input cases still fail in this local environment (one explicit EPERM). Verify and document the complete local coding workflow #172 tracks investigation. Required CI must pass before merge.Risks
Markdown's block query now explicitly includes child text in inline/code injections and includes table-cell nodes.
The supported-language list, cache strategy, buffer edits, and save behavior are unchanged.
The parent rollout's roadmap state is updated for the already merged direction decision.
Related issue
Closes #162.
Parent: #160.