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

Apply hint: use guards remove comments above #93

Closed
jneira opened this issue Nov 13, 2020 · 1 comment · Fixed by #101
Closed

Apply hint: use guards remove comments above #93

jneira opened this issue Nov 13, 2020 · 1 comment · Fixed by #101

Comments

@jneira
Copy link
Contributor

jneira commented Nov 13, 2020

Hi, using hls-hlint-plugin an user has detected that apply "use guards" remove comments above the inserted guard:

PS D:\dev\ws\haskell\cabal-test> cat .\src\HlintTests.hs
module HlintTests where

bar :: Maybe Int -> [Int] -> String
bar x y =
  -- this is a comment
  if isJust x then "1"
  else if Prelude.null y then "2"
  else "3"

PS D:\dev\ws\haskell\cabal-test> hlint .\src\HlintTests.hs --refactor
module HlintTests where

bar :: Maybe Int -> [Int] -> String
bar x y
  | isJust x = "1"
  | Prelude.null y = "2"
  | otherwise = "3"

PS D:\dev\ws\haskell\cabal-test> hlint --version
HLint v3.2.1, (C) Neil Mitchell 2006-2020
PS D:\dev\ws\haskell\cabal-test> refactor --version
v0.8.2.

Thanks in advance!

@zliu41
Copy link
Collaborator

zliu41 commented Nov 15, 2020

Thanks for the bug report. I opened ndmitchell/hlint#1165 for more discussion.

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

Successfully merging a pull request may close this issue.

2 participants