From 976247815a702918baaa653aaa474d6861d1f11e Mon Sep 17 00:00:00 2001 From: haya14busa Date: Sat, 15 Jun 2024 22:28:28 +0900 Subject: [PATCH] fix byte offset --- to-rdjsonl.jq | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/to-rdjsonl.jq b/to-rdjsonl.jq index bb04959..ea9e5da 100644 --- a/to-rdjsonl.jq +++ b/to-rdjsonl.jq @@ -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) } } }) }