Skip to content

Fix Diagnostic Snippets with Tabs#151

Open
rcosta358 wants to merge 1 commit intomainfrom
fix-tabs-diagnostic
Open

Fix Diagnostic Snippets with Tabs#151
rcosta358 wants to merge 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 labels Feb 14, 2026
@rcosta358 rcosta358 changed the title Fix Tabs for Diagnostic Marks Fix Diagnostic Snippets with Tabs Feb 14, 2026
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant