... | ... | @@ -820,7 +820,7 @@ applyRefactoring (Located e pm) r = (Located e apply) |
|
|
-- but stored as annotations.
|
|
|
```
|
|
|
|
|
|
## Example B: Remove unused import
|
|
|
### Example B: Remove unused import
|
|
|
|
|
|
**Let's assume the design in Example A**.
|
|
|
|
... | ... | @@ -839,4 +839,9 @@ And later in the pattern match for `apply`: |
|
|
-- somehow find the import based on the `SrcSpan`, as
|
|
|
-- `ParsedSource` will have a list of *located* `ImportDecl`
|
|
|
-- then delete the import from `hsmodImports`
|
|
|
``` |
|
|
\ No newline at end of file |
|
|
```
|
|
|
|
|
|
### Example C: Adding a missing do block
|
|
|
|
|
|
This is the hardest refactoring to apply (in my mind), because this would arise in the parser,
|
|
|
and at that stage we might not have a valid Haskell expression at hand, because the parsing failed. What to do? Perhaps we should not emit the `Refactoring` in that case? |
|
|
\ No newline at end of file |