Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- descriptor :: PluginId -> PluginDescriptor IdeState
- provider :: FormattingHandler IdeState
- formatText :: MonadIO m => DynFlags -> Maybe FilePath -> FormattingOptions -> Text -> m (Either [BrittanyError] Text)
- getConfFile :: NormalizedFilePath -> IO (Maybe FilePath)
- runBrittany :: Int -> DynFlags -> Maybe FilePath -> Text -> IO (Either [BrittanyError] Text)
- fromMaybeT :: Monad m => m a -> MaybeT m a -> m a
- opt :: a -> Option a
- showErr :: BrittanyError -> String
- showExtension :: Extension -> Maybe String
- getExtensions :: DynFlags -> [String]
Documentation
provider :: FormattingHandler IdeState Source #
Formatter provider of Brittany. Formats the given source in either a given Range or the whole Document. If the provider fails an error is returned that can be displayed to the user.
:: MonadIO m | |
=> DynFlags | |
-> Maybe FilePath | Path to configs. If Nothing, default configs will be used. |
-> FormattingOptions | Options for the formatter such as indentation. |
-> Text | Text to format |
-> m (Either [BrittanyError] Text) | Either formatted Text or a error from Brittany. |
Primitive to format text with the given option. May not throw exceptions but return a Left value. Errors may be presented to the user.
getConfFile :: NormalizedFilePath -> IO (Maybe FilePath) Source #
Recursively search in every directory of the given filepath for brittany.yaml. If no such file has been found, return Nothing.
:: Int | tab size |
-> DynFlags | |
-> Maybe FilePath | local config file |
-> Text | text to format |
-> IO (Either [BrittanyError] Text) |
Run Brittany on the given text with the given tab size and a configuration path. If no configuration path is given, a default configuration is chosen. The configuration may overwrite tab size parameter.
Returns either a list of Brittany Errors or the reformatted text. May not throw an exception.
fromMaybeT :: Monad m => m a -> MaybeT m a -> m a Source #
showErr :: BrittanyError -> String Source #
getExtensions :: DynFlags -> [String] Source #