-
-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
1 parent
6f105bd
commit 0403dbf
Showing
7 changed files
with
417 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.