haskell-language-server icon indicating copy to clipboard operation
haskell-language-server copied to clipboard

Fails to provide Quick Fix(es)

Open mouse07410 opened this issue 3 years ago • 6 comments

Your environment

  • Which OS do you use? macOS Monterey 12.5.1
  • Which version of GHC do you use and how did you install it? All installed via ghcup, GHC-9.2.4 and 9.4.2
  • How is your project built (alternative: link to the project)? Via Cabal-3.8.1.0
  • Which LSP client (editor/plugin) do you use? VS Codium+vscode-haskell
  • Which version of HLS do you use and how did you install it? master
ghcup compile his --git-ref master --ghc 9.4.2
ghcup compile his --git-ref master --ghc 9.2.4

Have you configured HLS in any way (especially: a hie.yaml file)?

cradle:
  cabal:
    - path: "src"
      component: "lib:stepic-tests"

    - path: "app/Main.hs"
      component: "stepic-tests:exe:stepic-tests-exe"

    - path: "app/Paths_stepic_tests.hs"
      component: "stepic-tests:exe:stepic-tests-exe"

    - path: "test"
      component: "stepic-tests:test:stepic-tests-test"

    - path: "app/MaybeDemo.hs"
      component: "stepic-tests:exe:maybe-demo"

    - path: "app/Paths_stepic_tests.hs"
      component: "stepic-tests:exe:maybe-demo"

Steps to reproduce

This happens occasionally with GHC-9.2.4, and always with 9.4.2.

Open .hs file in VS Code, edit the source to create "Redundant bracket" situation. E.g.:

failIndic :: [Maybe a] -> Bool
failIndic = (any isNothing)

Expected behaviour

In the error/warning popup, last line: clickable "View Problem" and clickable "Quick Fix... (Command .)"

Actual behaviour

In the error/warning popup, last line: clickable "View Problem" and "No quick fixes available"

P.S. I have screenshots, but GitHub decided to deny me the ability to upload them this time. ;-)

mouse07410 avatar Sep 07 '22 03:09 mouse07410

Do you get the hints from hlint if you run hlint on the file directly?

michaelpj avatar Sep 07 '22 08:09 michaelpj

hls-hlint-plugin is not supported for GHC 9.4, so that will explain the behaviour for that version.

wz1000 avatar Sep 07 '22 11:09 wz1000

Do you get the hints from hlint if you run hlint on the file directly?

Not sure. I do get suggestions, like

$ hlint Lexer.hs
Lexer.hs:19:14-28: Suggestion: Redundant bracket
Found:
  (all isDigit s)
Perhaps:
  all isDigit s

1 hint
$
$ hlint --version
HLint v3.3.6, (C) Neil Mitchell 2006-2021

hls-hlint-plugin is not supported for GHC 9.4, so that will explain the behaviour for that version.

Could you clarify please - not supported yet, or GHC starting with 9.4.x stops supporting hls-hlint-plugin? If the latter - does it mean that "Quick Fix..." capability will be lost (it's not crucial, but very convenient), or something else is coming to fill that gap?

mouse07410 avatar Sep 07 '22 11:09 mouse07410

It is not supported yet. We are blocked on upstream hlint support for GHC 9.4.2

wz1000 avatar Sep 07 '22 11:09 wz1000

We are blocked on upstream hlint support for GHC 9.4.2

Thank you for the explanation! Would you happen to know what's the expected/hoped/planned timeframe for having this resolved?

mouse07410 avatar Sep 09 '22 03:09 mouse07410

I went on the hlint issue tracker and looked for 9.4-related issues and it seems there are several (e.g. https://github.com/ndmitchell/hlint/issues/1413). So you can go look there if you're interested!

michaelpj avatar Sep 09 '22 03:09 michaelpj

Resolved

michaelpj avatar Jan 16 '24 18:01 michaelpj

@michaelpj thank you! (It would be nice to mention how it was resolved.)

mouse07410 avatar Jan 17 '24 03:01 mouse07410