haskell / haskell/haskell-language-server

Consider migrate the cache system to hls-graph

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

Description

Instead of scattering the cache system between hls-graph and ghcide. There might be a better idea, we can migrate the cache system to hls-graph. Since the scattering leads to some hard debugging bugs like https://github.com/haskell/haskell-language-server/pull/4185 https://github.com/haskell/haskell-language-server/issues/4093, although they've been solved.

But it is hard, It would require us to make a very good abstract of the current handling logic. And reimplement the following in hls-graph:

* garbage collector is in ghcide. There are special treatment for special keys.
* We have two fields in shakeExtra that's in the cache system. `dirtykeys` and `state`. And monitering is happening in ghcide.
* `data Value v` that wrap `FileVersion` and `PositionDelta`.
* specially treatment of special keys in `estimateFileVersionUnsafely`
* `lastValueIO` and it is entangling with `PositionMapping`

But we can take steps to do it too.
* The dirtiness keeping for instance is relatively easier target. see more at https://github.com/haskell/haskell-language-server/pull/4190#issuecomment-2100184202

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.