ghcide-1.6.0.0: The core of an IDE
Safe HaskellNone
LanguageHaskell2010

Development.IDE.Plugin.CodeAction.ExactPrint

Contents

Synopsis

Documentation

data Rewrite where Source #

Construct a Rewrite, replacing the node at the given SrcSpan with the given ast.

Constructors

Rewrite 

Fields

rewriteToEdit :: HasCallStack => DynFlags -> Anns -> Rewrite -> Either String [TextEdit] Source #

Convert a Rewrite into a list of '[TextEdit]'.

transferAnn :: (Data a, Data b) => Located a -> Located b -> (Annotation -> Annotation) -> TransformT (Either String) () Source #

Copy anns attached to a into b with modification, then delete anns of a

Utilities

appendConstraint Source #

Arguments

:: String

The new constraint to append

-> LHsType GhcPs

The type signature where the constraint is to be inserted, also assuming annotated

-> Rewrite 

Append a constraint at the end of a type context. If no context is present, a new one will be created.

removeConstraint Source #

Arguments

:: (LHsType GhcPs -> Bool)

Predicate: Which context to drop.

-> LHsType GhcPs 
-> Rewrite 

hideSymbol :: String -> LImportDecl GhcPs -> Rewrite Source #

Hide a symbol from import declaration

liftParseAST :: forall ast l. (ASTElement l ast, ExactPrint (LocatedAn l ast)) => DynFlags -> String -> TransformT (Either String) (LocatedAn l ast) Source #