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

Lint Plugin not displaying hints

Open gammison opened this issue 3 years ago • 1 comments

Your environment

Which OS do you use: Arch Linux

Which LSP client (editor/plugin) do you use:

Vim+Coc

Describe your project (alternative: link to the project):

Empty test project created with stack new test simple

Steps to reproduce

install HLS with ghcup, and use the following Coc config:

{
  "languageserver": {
    "haskell": {
      "command": "haskell-language-server-wrapper",
      "args": [
        "--lsp"
      ],
      "rootPatterns": [
        ".stack.yaml",
        ".hie-bios",
        "BUILD.bazel",
        "cabal.config",
        "package.yaml"
      ],
      "filetypes": [
        "hs",
        "lhs",
        "haskell"
      ],
      "initializationOptions": {
        "languageServerHaskell": {
          "hlintOn": true,
          "maxNumberOfProblems": 10,
          "completionSnippetsOn": true
        }
      }
    }
  },

  "coc.preferences.extensionUpdateCheck": "weekly"


}

Expected behaviour

The hlint plugin shouold display lint suggestions.

Actual behaviour

No lint suggestions would be displayed unless I deleted the Setup.hs file. If I was in a standalone haskell file, it would not work at all regardless. HLS would show compiler errors in vim properly regardless of the situation.

gammison avatar Apr 20 '22 06:04 gammison

I use a similar setup and lints work on GHC versions before 9.2.*.

To reproduce: Install HLS 1.7.0.0 via ghcup and run haskell-language-server-wrapper repro.hs (repro.hs can be some arbitrary file for which a warning should be produced, e.g. repro a = id a to get the eta-reduce suggestion).

With GHC 9.0.2 and 8.10.7 the expected suggestion is shown, but when GHC is set to 9.2.2 it is no longer in the output.

The hlint version installed via cabal is 3.4, although I do not know if this version is used by HLS if it is installed via ghcup.

danielrainer avatar May 21 '22 00:05 danielrainer

Tentatively closing as old and quiet, possibly due to a HLS distribution not including the hlint plugin.

michaelpj avatar Jan 16 '24 17:01 michaelpj