hls-brittany-plugin-1.0.0.1: Integration with the Brittany code formatter
Safe HaskellNone
LanguageHaskell2010

Ide.Plugin.Brittany

Synopsis

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.

formatText Source #

Arguments

:: 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.

runBrittany Source #

Arguments

:: 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 #

opt :: a -> Option a Source #