Commit 318112b
fix: use 1-indexed line numbers in error/warning positions (#9)
Changed adjustLineOffset to always add +1 when adjusting positions,
converting from 0-indexed grid rows to 1-indexed file line numbers.
Before: position.row = gridRow + lineOffset (0-indexed)
After: position.row = gridRow + lineOffset + 1 (1-indexed)
This ensures warnings like "MisalignedClosingBorder" report the actual
file line number users see in their editor, making debugging easier.
Example for a misalignment on Line 5 with scene directive:
- Grid row 3 (0-indexed in grid)
- lineOffset = 1 (for @scene directive)
- position.row = 3 + 1 + 1 = 5 (matches editor Line 5)
Updated E2E-13 test to verify position.row = 5 for Line 5.
Closes #9
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent c05458a commit 318112b
File tree
2 files changed
+23
-21
lines changed- src/parser
- Errors
- __tests__
2 files changed
+23
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
220 | 223 | | |
221 | | - | |
222 | | - | |
| 224 | + | |
| 225 | + | |
223 | 226 | | |
224 | 227 | | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
233 | 236 | | |
234 | 237 | | |
Lines changed: 10 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1022 | 1022 | | |
1023 | 1023 | | |
1024 | 1024 | | |
1025 | | - | |
| 1025 | + | |
1026 | 1026 | | |
1027 | 1027 | | |
1028 | 1028 | | |
1029 | 1029 | | |
1030 | | - | |
1031 | | - | |
1032 | | - | |
1033 | | - | |
1034 | | - | |
1035 | | - | |
1036 | | - | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
1037 | 1037 | | |
1038 | | - | |
1039 | | - | |
1040 | | - | |
| 1038 | + | |
| 1039 | + | |
1041 | 1040 | | |
1042 | 1041 | | |
1043 | 1042 | | |
| |||
0 commit comments