You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use exact print for suggest missing constraint code actions (#1221)
* Cache annotated AST
* instance ASTElement RdrName
* appendConstraint + Rewrite abstraction
The Rewrite abstraction is similar to D.IDE.GHC.ExactPrint.Graft but it
does fewer things more efficiently:
- It doesn't annotate things for you (so it doesn't destroy user format)
- It doesn't provide a Monoid instance (for now)
- It doesn't need a fully parsed source
- It doesn't use SYB to perform the replacement
- It doesn't diff to compute the result
The use case is code actions where you don't have the SrcSpan that you need to
edit at hand, and instead you need to traverse the AST manually to locate the declaration to edit
* Refactor suggest constraint code action to use exactprint
Tweaking the suggest constraints tests to reflect the increased precision in
whitespace preservation
* Catch missing 'Monad m' constraints too
* Suggestions for missing implicit parameters
* hlints
* compat
* Include getAnnotatedParsedSourceRule in the main rule
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
0 commit comments