Skip to content

HLS hangs when given an invalid hlint annotation #1908

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

Open
expipiplus1 opened this issue Jun 10, 2021 · 2 comments
Open

HLS hangs when given an invalid hlint annotation #1908

expipiplus1 opened this issue Jun 10, 2021 · 2 comments
Labels
component: hls-hlint-plugin type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@expipiplus1
Copy link
Contributor

Your environment

Output of haskell-language-server --probe-tools or haskell-language-server-wrapper --probe-tools:

❯ haskell-language-server-wrapper --probe-tools
haskell-language-server version: 1.1.0.0 (GHC: 8.10.4) (PATH: /nix/store/yc9ljhg8fgb8k8zjlgid04qkq3ffzm5s-haskell-language-server-1.1.0.0/bin/haskell-language-server-wrapper)
Tool versions found on the $PATH
cabal:          3.4.0.0
stack:          Not found
ghc:            8.10.4

Which OS do you use:

Which lsp-client do you use: coc.nvim in neovim on nixos

Describe your project (alternative: link to the project): this commit expipiplus1/fourmolu@6091ab4#diff-7db35ce2b13b8bb7dc43a789dc3cf6074abe57a77051f98a5e7090a09bb6b206R42

Contents of hie.yaml:

cradle:
  multi:
    - path: "data"
      config: { cradle: { none: }}
    - path: "region-tests"
      config: { cradle: { none: }}

    - path: "."
      config:
        cradle:
          cabal:
            - path: "src"
              component: "lib:fourmolu"

            - path: "app"
              component: "fourmolu:exe:fourmolu"

            - path: "tests"
              component: "fourmolu:test:tests"

Steps to reproduce

Clone fourmolu at this commit expipiplus1/fourmolu@6091ab4#diff-7db35ce2b13b8bb7dc43a789dc3cf6074abe57a77051f98a5e7090a09bb6b206R42

Expected behaviour

hls should terminate

Actual behaviour

haskell-language-server doesn't terminate, the last message is

/home/j/src/fourmolu/src/Ormolu/Printer/Meat/Declaration/Value.hs:42:16-56: Error while reading hint file, bad classify pragma
("Hlint: inore use camelCase " :: String)

(not the misspelled 'ignore')

It does respond to SIGTERM

Include debug information

Execute in the root of your project the command haskell-language-server --debug . and paste the logs here:

https://gist.github.com/2e49d2524c9faaa638bebaa919943c82

Things work correctly when 'ignore' is spelled correctly.

@jneira jneira added component: hls-hlint-plugin type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels Jun 10, 2021
@ndmitchell
Copy link
Collaborator

All the HLint code that I can see happens under a define, and that could should have catch handlers around it which automatically turn exceptions into errors. I think fixing this particular issue in the HLint plugin would be good (probably adding a specific catch there), but even better to catch it in the define too, so plugins that are slightly wrong don't bring down HLS.

@jneira
Copy link
Member

jneira commented Jan 31, 2022

General issue about better error handling of plugins: #1231

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: hls-hlint-plugin type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

No branches or pull requests

3 participants