File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
ghcide/src/Development/IDE/Core
plugins/hls-hlint-plugin/src/Ide/Plugin Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -178,6 +178,7 @@ import System.FilePath hiding (makeRelative)
178178import System.IO.Unsafe (unsafePerformIO )
179179import System.Time.Extra
180180import UnliftIO (MonadUnliftIO (withRunInIO ))
181+ import qualified UnliftIO.Exception as UE
181182
182183
183184data Log
@@ -1477,7 +1478,8 @@ kickSignal testing lspEnv files msg = when testing $ liftIO $ mRunLspT lspEnv $
14771478-- | Add kick start/done signal to rule
14781479runWithSignal :: (KnownSymbol s0 , KnownSymbol s1 , IdeRule k v ) => Proxy s0 -> Proxy s1 -> [NormalizedFilePath ] -> k -> Action ()
14791480runWithSignal msgStart msgEnd files rule = do
1480- ShakeExtras {ideTesting = Options. IdeTesting testing, lspEnv} <- getShakeExtras
1481- kickSignal testing lspEnv files msgStart
1482- void $ uses rule files
1483- kickSignal testing lspEnv files msgEnd
1481+ ShakeExtras {ideTesting = Options. IdeTesting testing, lspEnv} <- getShakeExtras
1482+ UE. bracket_
1483+ (kickSignal testing lspEnv files msgStart)
1484+ (kickSignal testing lspEnv files msgEnd)
1485+ $ void $ uses rule files
Original file line number Diff line number Diff line change @@ -66,7 +66,8 @@ import System.Environment (setEnv,
6666import Development.IDE.GHC.Compat (DynFlags ,
6767 extensionFlags ,
6868 ms_hspp_opts ,
69- topDir )
69+ topDir ,
70+ uninterruptibleMaskM_ )
7071import qualified Development.IDE.GHC.Compat.Util as EnumSet
7172
7273#if MIN_GHC_API_VERSION(9,4,0)
@@ -205,7 +206,10 @@ rules recorder plugin = do
205206
206207 defineNoFile (cmapWithPrio LogShake recorder) $ \ GetHlintSettings -> do
207208 (Config flags) <- getHlintConfig plugin
208- liftIO $ argsSettings flags
209+ -- argsSettings might capture async exceptions and throw it everytime we call it.
210+ -- So we must mask async exceptions here as an workaround.
211+ -- See https://github.com/haskell/haskell-language-server/issues/4718
212+ liftIO $ uninterruptibleMask_ $ argsSettings flags
209213
210214 action $ do
211215 files <- Map. keys <$> getFilesOfInterestUntracked
You can’t perform that action at this time.
0 commit comments