Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug in "Delete top-binding" codeaction #858

Closed
sureyeaah opened this issue Jul 27, 2020 · 2 comments
Closed

bug in "Delete top-binding" codeaction #858

sureyeaah opened this issue Jul 27, 2020 · 2 comments

Comments

@sureyeaah
Copy link
Contributor

Consider the following:

{-# OPTIONS_GHC -Wunused-top-binds #-}
{-# OPTIONS_GHC -Wunused-binds #-}
module X (foo, bar) where

foo = id
  where
    bar = ()
//  ^^^
bar = id
  1. The codeaction is offered for bar (it should not be!).
  2. It deletes the top-level bar (it should delete the local bar instead).

see haskell/ghcide#711 for fix to same problem in different codeaction.

@rayshih
Copy link
Contributor

rayshih commented Aug 9, 2020

Just created a WIP commit for this: rayshih/ghcide#1

Will polish that and recreate a real PR

rayshih referenced this issue in rayshih/ghcide Aug 12, 2020
pepeiborra referenced this issue in haskell/ghcide Sep 2, 2020
* [CodeAction] reimplement suggestDeleteBinding

* [CodeAction] handle whole line removal for suggestDeleteUnusedBinding

* [CodeAction] add test for bug #710

* [CodeAction] add more tests for suggesting unused binding

* fix hlint warnings

* fix hlint warnings

* remove unused imports

* fix compilation problem for 8.4

* remove redundant pattern matching

* reconcile the disagreement of a pattern matching is redundant
@pepeiborra
Copy link
Collaborator

Think we can close this now

pepeiborra referenced this issue in pepeiborra/ide Dec 29, 2020
…ide#728)

* [CodeAction] reimplement suggestDeleteBinding

* [CodeAction] handle whole line removal for suggestDeleteUnusedBinding

* [CodeAction] add test for bug haskell/ghcide#710

* [CodeAction] add more tests for suggesting unused binding

* fix hlint warnings

* fix hlint warnings

* remove unused imports

* fix compilation problem for 8.4

* remove redundant pattern matching

* reconcile the disagreement of a pattern matching is redundant
pepeiborra referenced this issue in pepeiborra/ide Dec 29, 2020
…ide#728)

* [CodeAction] reimplement suggestDeleteBinding

* [CodeAction] handle whole line removal for suggestDeleteUnusedBinding

* [CodeAction] add test for bug haskell/ghcide#710

* [CodeAction] add more tests for suggesting unused binding

* fix hlint warnings

* fix hlint warnings

* remove unused imports

* fix compilation problem for 8.4

* remove redundant pattern matching

* reconcile the disagreement of a pattern matching is redundant
pepeiborra referenced this issue in pepeiborra/ide Dec 29, 2020
…ide#728)

* [CodeAction] reimplement suggestDeleteBinding

* [CodeAction] handle whole line removal for suggestDeleteUnusedBinding

* [CodeAction] add test for bug haskell/ghcide#710

* [CodeAction] add more tests for suggesting unused binding

* fix hlint warnings

* fix hlint warnings

* remove unused imports

* fix compilation problem for 8.4

* remove redundant pattern matching

* reconcile the disagreement of a pattern matching is redundant
@pepeiborra pepeiborra transferred this issue from haskell/ghcide Jan 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants