You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Align diagnostic carets with tabs and wide Unicode characters #489
bugA problem that causes incorrect behavior or crashes.help wantedThe issue requires extra attention or help from others.ui/uxIssues related to the user interface or user experience.
The compiler correctly reports :2:2 in Unicode scalar coordinates. The source row contains a literal tab, but the caret row uses one ordinary space, so the underline appears before the identifier in a terminal. A second reproducer is:
fun main() {
var 이름: i32 = 1; 이름; missing;
}
Its stored scalar column is correctly 26, but the preceding Korean characters occupy two terminal cells each and the underline is visually displaced.
Cause and scope
front/error/src/error.rs::display_source_block prints source lines verbatim and pads the caret with column - 1 spaces. It uses source-coordinate counts as display widths. #406/#486 fix which source occurrence is selected; this follow-up concerns terminal rendering only.
Acceptance
Compute caret display offsets from the actual source prefix, including tabs and wide characters, with a documented tab policy.
Apply the same rule to full-source and single-line diagnostic rendering.
Add focused output tests for a tab-indented error, wide characters before an error and ordinary ASCII.
Preserve UTF-8 byte spans and one-based Unicode scalar coordinates in JSON; do not convert the machine-readable location contract to terminal cells.
Keep the underline immediately after the failing source row.
Start with front/error/src/error.rs and tests/frontend_regressions.rs. Related documentation task #404 remains separate.
bugA problem that causes incorrect behavior or crashes.help wantedThe issue requires extra attention or help from others.ui/uxIssues related to the user interface or user experience.
Activity