haskell / haskell-language-server

Official haskell ide support via language server (LSP). Successor of ghcide & haskell-ide-engine.
Apache License 2.0
2.66k stars 355 forks source link

Formalize the ProgressReporting Type #4335

Closed soulomoon closed 3 months ago

soulomoon commented 3 months ago

follow up of https://github.com/haskell/haskell-language-server/pull/4205 This is intended to remove the useless inProgress when tracking the inProgressState from the outside.

  1. Add kind data ProgressStateTrackingType = ProgressStateInsideTracking | ProgressStateOutsideTracking to distinguish the two type of inProgressState tracking.
  2. Spread the TProgressState to related type location to mark what kind of tracking we used. Then we won't have inProgress for ProgressStateOutsideTracking
michaelpj commented 3 months ago

I'm not sure I see the attraction of this design, to be honest. I think we could instead see the tracking with files as a wrapper on top of the simpler progressCounter that just works with the STM Ints. That would mean we have two different types for the two different counters, rather than just one with a type parameter, but I think it would be simpler?

soulomoon commented 3 months ago

Good suggestions @michaelpj , I've managed to change it to the wrapper version, Seems much simpler using the wrapper version here.

michaelpj commented 3 months ago

Looks much better