Add new replacement format to the JSON

This commit is contained in:
Vidar Holen 2019-01-09 18:35:36 -08:00
parent fd2beaadfa
commit fcdd6055df
1 changed files with 7 additions and 2 deletions

View File

@ -45,11 +45,16 @@ instance ToJSON Replacement where
end = repEndPos replacement end = repEndPos replacement
str = repString replacement in str = repString replacement in
object [ object [
"precedence" .= repPrecedence replacement,
"insertionPoint" .=
case repInsertionPoint replacement of
InsertBefore -> "beforeStart" :: String
InsertAfter -> "afterEnd",
"line" .= posLine start, "line" .= posLine start,
"endLine" .= posLine end,
"column" .= posColumn start, "column" .= posColumn start,
"endLine" .= posLine end,
"endColumn" .= posColumn end, "endColumn" .= posColumn end,
"replaceWith" .= str "replacement" .= str
] ]
instance ToJSON PositionedComment where instance ToJSON PositionedComment where