haskell / haskell/haskell-language-server

HLS 1.9 seems to do a huge amount of work when multiple units are open and one file is changed

Open
#3,458 14 comments 3 reactions 0 assignees View on GitHub
performance priority: high type: bug
Dominant language
Haskell
Stars
3k
Forks
455
Avg merge
2d 19h
Merged PRs (30d)
11

Description

### Your environment

NixOS, GHC 9.2.5, Haskell.nix, Helix. `hie.yaml` is:

```yaml
cradle:
cabal:
```

### Steps to reproduce

Open two files in the same `cabal.project` that belong to different units, I think where the files are somewhat dependent (e.g., `A.hs` is a dependency of `B.hs`). Then edit something in `A.hs` that causes a type error (syntax errors don't seem to be affected) and wait a long time until any error feedback arrives.

### Expected behaviour

HLS reports the typo promptly.

### Actual behaviour

I've tried to record this happening with asciinema, but it's maybe not immediately obvious. See https://asciinema.org/a/hymieQM8CZY4KkIRnfJERrnwX.

In the first 20s or so I open one file and make some edits to current errors. When I make changes, the error goes away (while type checking happens) and then comes back, pretty swiftly. Next, I open a new file, and then return to the original file. Now making the same edits takes a lot longer. Also notice the status line at the bottom - it starts showing a lot more activity, but I don't really know what it means.

As my session grows, this time gets much much longer, to the point where I find myself waiting upwards of 10/20s just to get any feedback.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.