Skip to content

Project indexing doesn't finish, probably due to "type" import? #2025

Closed
@jhrcek

Description

@jhrcek

I'm using recent version of hls and I'm hitting this bug during indexing of my project.
It seems to be related to "type" imports.
I tried to find which head call in hls codebase could be behind this, but there are too many head calls to know for sure.
If you could help me identify which occurrence of head might be causing this issue, I could try to fix it

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.2.0.0 (GHC: 8.8.4) (PATH: /home/jhrcek/.local/bin/haskell-language-server-wrapper) (GIT hash: 92e4bad5b6c5432938ae0842e9ddd569bf0cdff8)
Tool versions found on the $PATH
cabal:		3.4.0.0
stack:		2.7.1
ghc:		8.8.4

Which OS do you use:
Linux, Fedora 34
Which lsp-client do you use:
VS Code
Describe your project (alternative: link to the project):
N/A

Steps to reproduce

This screenshot should sum it up just fine
hls-indexing-stuck

Expected behaviour

Project indexing should finish

Actual behaviour

Include debug information

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

This command runs fine and doesn't print anything related. But nevertheless the VSCode ui gets stuck on indexing.

Paste the logs from the lsp-client, e.g. for VS Code

Pasting just few log lines that surround the Prelude.head: empty list error..

LSP logs:
2021-07-19 09:25:26.21620834 [ThreadId 1405] INFO hls:	finish: Wingman.judgementForHole.TypeCheck (took 0.00s)
2021-07-19 09:25:26.219038669 [ThreadId 1405] INFO hls:	finish: Wingman.judgementForHole.GhcSessionDeps (took 0.00s)
2021-07-19 09:25:26.351273507 [ThreadId 1741] INFO hls:	finish: Wingman.emptyCaseScrutinees.GhcSessionDeps (took 0.00s)
2021-07-19 09:25:26.352217492 [ThreadId 1741] INFO hls:	finish: codeLens.GetGlobalBindingTypeSigs (took 0.14s)
2021-07-19 09:25:27.356491874 [ThreadId 1742] INFO hls:	finish: GhcideCodeActions.GetAnnotatedParsedSource (took 0.00s)
2021-07-19 09:25:27.357057045 [ThreadId 1742] INFO hls:	finish: GhcideCodeActions.GetParsedModule (took 0.00s)
2021-07-19 09:25:27.35733881 [ThreadId 1742] INFO hls:	finish: GhcideCodeActions.GetFileContents (took 0.00s)
2021-07-19 09:25:27.441057756 [ThreadId 1742] INFO hls:	finish: GhcideCodeActions.TypeCheck (took 0.00s)
2021-07-19 09:25:27.444346666 [ThreadId 1405] INFO hls:	finish: GhcideCodeActions.GetHieAst (took 0.00s)
2021-07-19 09:25:27.445053112 [ThreadId 1405] INFO hls:	finish: GhcideCodeActions.getParsedModule (took 0.00s)
2021-07-19 09:25:27.996904126 [ThreadId 1742] INFO hls:	finish: RefineImports (took 8.76s)
2021-07-19 09:25:27.997052683 [ThreadId 1742] INFO hls:	finish: RefineImports (took 8.81s)
2021-07-19 09:25:27.997096856 [ThreadId 1742] INFO hls:	finish: RefineImports (took 2.35s)
haskell-language-server-8.8.4: Prelude.head: empty list
2021-07-19 09:25:28.824963259 [ThreadId 2045] INFO hls:	finish: RefineImports (took 9.63s)

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: ghcidecomponent: hiedbtype: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions