Skip to content

Apply hint: use guards remove comments above #93

Closed
@jneira

Description

@jneira

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions