Skip to content

Comments

Fix Diagnostic Snippets with Tabs#151

Merged
rcosta358 merged 1 commit intomainfrom
fix-tabs-diagnostic
Feb 23, 2026
Merged

Fix Diagnostic Snippets with Tabs#151
rcosta358 merged 1 commit intomainfrom
fix-tabs-diagnostic

Conversation

@rcosta358
Copy link
Collaborator

@rcosta358 rcosta358 commented Feb 14, 2026

This PR improves the accuracy of diagnostic code snippets by correctly handling tab characters when displaying error markers. This ensures that caret markers (^) align visually with the intended columns, even when the source code contain tabs instead of spaces.

Before

Refinement Error: #x_1 == -1 is not a subtype of #x_1 > 0
10 |    void test() {
11 |            @Refinement("_ > 0")
12 |            int x = -1;
   |       ^^^^^^^
13 |    }
14 | 

After

Refinement Error: #x_1 == -1 is not a subtype of #x_1 > 0
10 |     void test() {
11 |         @Refinement("_ > 0")
12 |         int x = -1;
   |             ^^^^^^^
13 |     }
14 | 

@rcosta358 rcosta358 self-assigned this Feb 14, 2026
@rcosta358 rcosta358 added bug Something isn't working error messages Related to error messages labels Feb 14, 2026
@rcosta358 rcosta358 changed the title Fix Tabs for Diagnostic Marks Fix Diagnostic Snippets with Tabs Feb 14, 2026
Copy link
Collaborator

@CatarinaGamboa CatarinaGamboa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@rcosta358 rcosta358 merged commit 14cc5eb into main Feb 23, 2026
1 check passed
@rcosta358 rcosta358 deleted the fix-tabs-diagnostic branch February 23, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working error messages Related to error messages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants