mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-08 15:27:02 +08:00
Change definition of Replacement, add ToJSON instance for it
This commit is contained in:
@@ -50,7 +50,8 @@ module ShellCheck.Interface
|
||||
, newPositionedComment
|
||||
, newComment
|
||||
, Fix
|
||||
, Replacement(R)
|
||||
, Replacement(repStartPos, repEndPos, repString)
|
||||
, newReplacement
|
||||
) where
|
||||
|
||||
import ShellCheck.AST
|
||||
@@ -196,9 +197,17 @@ newComment = Comment {
|
||||
}
|
||||
|
||||
-- only support single line for now
|
||||
data Replacement =
|
||||
R Position Position String
|
||||
deriving (Show, Eq)
|
||||
data Replacement = Replacement {
|
||||
repStartPos :: Position,
|
||||
repEndPos :: Position,
|
||||
repString :: String
|
||||
} deriving (Show, Eq)
|
||||
|
||||
newReplacement = Replacement {
|
||||
repStartPos = newPosition,
|
||||
repEndPos = newPosition,
|
||||
repString = ""
|
||||
}
|
||||
|
||||
type Fix = [Replacement]
|
||||
|
||||
|
Reference in New Issue
Block a user