mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-30 11:39:20 -07:00
Change definition of Replacement, add ToJSON instance for it
This commit is contained in:
parent
4a87d2a3de
commit
5ed89d2241
4 changed files with 48 additions and 16 deletions
|
@ -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]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue