From fcdd6055df1600d18466aa900dcdfddef9fc299e Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Wed, 9 Jan 2019 18:35:36 -0800 Subject: [PATCH] Add new replacement format to the JSON --- src/ShellCheck/Formatter/JSON.hs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ShellCheck/Formatter/JSON.hs b/src/ShellCheck/Formatter/JSON.hs index 9aec751..02a549d 100644 --- a/src/ShellCheck/Formatter/JSON.hs +++ b/src/ShellCheck/Formatter/JSON.hs @@ -45,11 +45,16 @@ instance ToJSON Replacement where end = repEndPos replacement str = repString replacement in object [ + "precedence" .= repPrecedence replacement, + "insertionPoint" .= + case repInsertionPoint replacement of + InsertBefore -> "beforeStart" :: String + InsertAfter -> "afterEnd", "line" .= posLine start, - "endLine" .= posLine end, "column" .= posColumn start, + "endLine" .= posLine end, "endColumn" .= posColumn end, - "replaceWith" .= str + "replacement" .= str ] instance ToJSON PositionedComment where