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)
178
178
import System.IO.Unsafe (unsafePerformIO )
179
179
import System.Time.Extra
180
180
import UnliftIO (MonadUnliftIO (withRunInIO ))
181
+ import qualified UnliftIO.Exception as UE
181
182
182
183
183
184
data Log
@@ -1477,7 +1478,8 @@ kickSignal testing lspEnv files msg = when testing $ liftIO $ mRunLspT lspEnv $
1477
1478
-- | Add kick start/done signal to rule
1478
1479
runWithSignal :: (KnownSymbol s0 , KnownSymbol s1 , IdeRule k v ) => Proxy s0 -> Proxy s1 -> [NormalizedFilePath ] -> k -> Action ()
1479
1480
runWithSignal 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,
66
66
import Development.IDE.GHC.Compat (DynFlags ,
67
67
extensionFlags ,
68
68
ms_hspp_opts ,
69
- topDir )
69
+ topDir ,
70
+ uninterruptibleMaskM_ )
70
71
import qualified Development.IDE.GHC.Compat.Util as EnumSet
71
72
72
73
#if MIN_GHC_API_VERSION(9,4,0)
@@ -205,7 +206,10 @@ rules recorder plugin = do
205
206
206
207
defineNoFile (cmapWithPrio LogShake recorder) $ \ GetHlintSettings -> do
207
208
(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
209
213
210
214
action $ do
211
215
files <- Map. keys <$> getFilesOfInterestUntracked
You can’t perform that action at this time.
0 commit comments