Safe Haskell | None |
---|---|
Language | Haskell2010 |
The formatter is designed in a way that can be consumed both by the CLI and the LSP server.
Synopsis
- data FormattingEdit = FormattingEdit Int Int Int Int String
- formatTextEdits :: String -> [FormattingEdit]
- format :: String -> String
- formatFile :: FilePath -> IO String
- formatFileWrite :: FilePath -> IO ()
- isWellFormatted :: String -> Bool
- isWellFormattedFile :: FilePath -> IO Bool
Documentation
data FormattingEdit Source #
All indices are 1-based (as received from the lexer) Note: LSP uses 0-based indices
Instances
Show FormattingEdit Source # | |
Defined in Rzk.Format showsPrec :: Int -> FormattingEdit -> ShowS # show :: FormattingEdit -> String # showList :: [FormattingEdit] -> ShowS # | |
Eq FormattingEdit Source # | |
Defined in Rzk.Format (==) :: FormattingEdit -> FormattingEdit -> Bool # (/=) :: FormattingEdit -> FormattingEdit -> Bool # | |
Ord FormattingEdit Source # | |
Defined in Rzk.Format compare :: FormattingEdit -> FormattingEdit -> Ordering # (<) :: FormattingEdit -> FormattingEdit -> Bool # (<=) :: FormattingEdit -> FormattingEdit -> Bool # (>) :: FormattingEdit -> FormattingEdit -> Bool # (>=) :: FormattingEdit -> FormattingEdit -> Bool # max :: FormattingEdit -> FormattingEdit -> FormattingEdit # min :: FormattingEdit -> FormattingEdit -> FormattingEdit # |
formatTextEdits :: String -> [FormattingEdit] Source #
formatFileWrite :: FilePath -> IO () Source #
Format the file and write the result back to the file.
isWellFormatted :: String -> Bool Source #
Check if the given Rzk source code is well formatted. This is useful for automation tasks.
isWellFormattedFile :: FilePath -> IO Bool Source #
Same as isWellFormatted
, but reads the source code from a file.