ghcide-2.7.0.0: The core of an IDE

Safe Haskell | None
Language | GHC2021

Development.IDE.Core.ProgressReporting

Synopsis

- data ProgressEvent
  - = KickStarted
  - | KickCompleted
- data ProgressReporting = ProgressReporting {
  - progressUpdate :: ProgressEvent -> IO ()
  - inProgress :: forall a. NormalizedFilePath -> Action a -> Action a
  - progressStop :: IO ()
  }
- noProgressReporting :: IO ProgressReporting
- delayedProgressReporting :: Seconds -> Seconds -> Maybe (LanguageContextEnv c) -> ProgressReportingStyle -> IO ProgressReporting
- mRunLspT :: Applicative m => Maybe (LanguageContextEnv c) -> LspT c m () -> m ()
- mRunLspTCallback :: Monad m => Maybe (LanguageContextEnv c) -> (LspT c m a -> LspT c m a) -> m a -> m a
- recordProgress :: InProgressState -> NormalizedFilePath -> (Int -> Int) -> IO ()
- data InProgressState = InProgressState {
  - todoVar :: TVar Int
  - doneVar :: TVar Int
  - currentVar :: Map NormalizedFilePath Int
  }

# Documentation

data ProgressEvent #

Constructors

KickStarted |
KickCompleted |

data ProgressReporting #

Constructors

ProgressReporting |

Fields

- progressUpdate :: ProgressEvent -> IO ()
- inProgress :: forall a. NormalizedFilePath -> Action a -> Action a
- progressStop :: IO ()

noProgressReporting :: IO ProgressReporting #

delayedProgressReporting #

Arguments

:: Seconds | Grace period before starting
-> Seconds | sampling delay
-> Maybe (LanguageContextEnv c) |
-> ProgressReportingStyle |
-> IO ProgressReporting |

A `ProgressReporting` that enqueues Begin and End notifications in a new thread, with a grace period (nothing will be sent if `KickCompleted` arrives before the end of the grace period).

mRunLspT :: Applicative m => Maybe (LanguageContextEnv c) -> LspT c m () -> m () #

mRunLspTCallback :: Monad m => Maybe (LanguageContextEnv c) -> (LspT c m a -> LspT c m a) -> m a -> m a #

recordProgress :: InProgressState -> NormalizedFilePath -> (Int -> Int) -> IO () #

data InProgressState #

Data structure to track progress across the project

Constructors

InProgressState |

Fields

- todoVar :: TVar Int

  Number of files to do

- doneVar :: TVar Int

  Number of files done

- currentVar :: Map NormalizedFilePath Int