haskell / haskell/haskell-language-server

High cpu and memory usage with lens typed holes

Open
#2,731 4 comments 0 reactions 0 assignees View on GitHub
type: enhancement
Dominant language
Haskell
Stars
3k
Forks
455
Avg merge
2d 19h
Merged PRs (30d)
11

Description

### Your environment

WSL2 Ubuntu 20.04

vscode-haskell

my cabal file
```cabal
cabal-version: 2.4
name: hls-lens-hole
version: 0.1.0.0

executable hls-lens-hole
main-is: Main.hs
build-depends: base ^>=4.14.3.0, lens
hs-source-dirs: app
default-language: Haskell2010
```
ghc version
```
The Glorious Glasgow Haskell Compilation System, version 8.10.7
```
cabal
```
cabal-install version 3.6.2.0
compiled using version 3.6.2.0 of the Cabal library
```
HLS version (vscode-haskell installs the latest version automatically)
```
ls ~/.vscode-server/data/User/globalStorage/haskell.haskell/
haskell-language-server-wrapper-1.6.1.0-linux
haskell-language-server-1.6.1.0-linux-8.10.7
```
### Steps to reproduce

open the following code in vscode
```hs
pair :: IndexedFold Bool (a, a) a
pair p (a, b) = _ -- (,) <$> indexed p False a <*> indexed p True b
```
hover over the hole, then inspect other variables (e.g. `a` or `b`).
### Expected behaviour

don't crash
### Actual behaviour

HLS may be slow with some holes (lens is big) but it shouldn't crash. HLS tries to load but not showing the result (cpu and memory usage are super high), after a few tries it crashes.

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.