Skip to content

Commit

Permalink
fix byte offset
Browse files Browse the repository at this point in the history
  • Loading branch information
haya14busa committed Jun 15, 2024
1 parent fe2baa1 commit 9762478
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions to-rdjsonl.jq
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ if .type == "typo" then
"location": {
"path": .path,
"range": {
"start": { "line": .line_num, "column": .byte_offset },
"end": { "line": .line_num, "column": (.byte_offset + (.typo | length)) }
"start": { "line": .line_num, "column": .byte_offset + 1 },
"end": { "line": .line_num, "column": (.byte_offset + (.typo | length) + 1) }
}
},
"suggestions": .corrections | map({
"text": .,
"range": {
"start": { "line": $item.line_num, "column": $item.byte_offset },
"end": { "line": $item.line_num, "column": ($item.byte_offset + ($item.typo | length)) }
"start": { "line": $item.line_num, "column": $item.byte_offset + 1 },
"end": { "line": $item.line_num, "column": ($item.byte_offset + ($item.typo | length) + 1) }
}
})
}
Expand Down

0 comments on commit 9762478

Please sign in to comment.