@@ -99,10 +99,10 @@ import Data.EnumMap.Strict (EnumMap)
99
99
import qualified Data.EnumMap.Strict as EM
100
100
import Data.Foldable (for_ , toList )
101
101
import Data.Functor ((<&>) )
102
+ import Data.Hashable
102
103
import qualified Data.HashMap.Strict as HMap
103
104
import Data.HashSet (HashSet )
104
105
import qualified Data.HashSet as HSet
105
- import Data.Hashable
106
106
import Data.IORef
107
107
import Data.List.Extra (foldl' , partition ,
108
108
takeEnd )
@@ -148,12 +148,12 @@ import Development.IDE.Types.KnownTargets
148
148
import Development.IDE.Types.Location
149
149
import Development.IDE.Types.Logger hiding (Priority )
150
150
import qualified Development.IDE.Types.Logger as Logger
151
+ import Development.IDE.Types.Monitoring (Monitoring (.. ))
151
152
import Development.IDE.Types.Options
152
153
import Development.IDE.Types.Shake
153
154
import qualified Focus
154
155
import GHC.Fingerprint
155
- import Language.LSP.Types.Capabilities
156
- import OpenTelemetry.Eventlog
156
+ import GHC.Stack (HasCallStack )
157
157
import HieDb.Types
158
158
import Ide.Plugin.Config
159
159
import qualified Ide.PluginUtils as HLS
@@ -162,13 +162,14 @@ import Language.LSP.Diagnostics
162
162
import qualified Language.LSP.Server as LSP
163
163
import Language.LSP.Types
164
164
import qualified Language.LSP.Types as LSP
165
+ import Language.LSP.Types.Capabilities
165
166
import Language.LSP.VFS
166
167
import qualified "list-t" ListT
168
+ import OpenTelemetry.Eventlog
167
169
import qualified StmContainers.Map as STM
168
170
import System.FilePath hiding (makeRelative )
169
- import System.IO.Unsafe (unsafePerformIO )
171
+ import System.IO.Unsafe (unsafePerformIO )
170
172
import System.Time.Extra
171
- import Development.IDE.Types.Monitoring (Monitoring (.. ))
172
173
173
174
data Log
174
175
= LogCreateHieDbExportsMapStart
@@ -341,7 +342,7 @@ addIdeGlobalExtras ShakeExtras{globals} x@(typeOf -> ty) =
341
342
Just _ -> error $ " Internal error, addIdeGlobalExtras, got the same type twice for " ++ show ty
342
343
Nothing -> HMap. insert ty (toDyn x) mp
343
344
344
- getIdeGlobalExtras :: forall a . IsIdeGlobal a => ShakeExtras -> IO a
345
+ getIdeGlobalExtras :: forall a . ( HasCallStack , IsIdeGlobal a ) => ShakeExtras -> IO a
345
346
getIdeGlobalExtras ShakeExtras {globals} = do
346
347
let typ = typeRep (Proxy :: Proxy a )
347
348
x <- HMap. lookup (typeRep (Proxy :: Proxy a )) <$> readTVarIO globals
@@ -351,13 +352,12 @@ getIdeGlobalExtras ShakeExtras{globals} = do
351
352
| otherwise -> errorIO $ " Internal error, getIdeGlobalExtras, wrong type for " ++ show typ ++ " (got " ++ show (dynTypeRep x) ++ " )"
352
353
Nothing -> errorIO $ " Internal error, getIdeGlobalExtras, no entry for " ++ show typ
353
354
354
- getIdeGlobalAction :: forall a . IsIdeGlobal a => Action a
355
+ getIdeGlobalAction :: forall a . ( HasCallStack , IsIdeGlobal a ) => Action a
355
356
getIdeGlobalAction = liftIO . getIdeGlobalExtras =<< getShakeExtras
356
357
357
358
getIdeGlobalState :: forall a . IsIdeGlobal a => IdeState -> IO a
358
359
getIdeGlobalState = getIdeGlobalExtras . shakeExtras
359
360
360
-
361
361
newtype GlobalIdeOptions = GlobalIdeOptions IdeOptions
362
362
instance IsIdeGlobal GlobalIdeOptions
363
363
@@ -756,7 +756,7 @@ newSession recorder extras@ShakeExtras{..} vfsMod shakeDb acts reason = do
756
756
757
757
-- Take a new VFS snapshot
758
758
case vfsMod of
759
- VFSUnmodified -> pure ()
759
+ VFSUnmodified -> pure ()
760
760
VFSModified vfs -> atomically $ writeTVar vfsVar vfs
761
761
762
762
IdeOptions {optRunSubset} <- getIdeOptionsIO extras
0 commit comments