Skip to content

Commit c9926d4

Browse files
committed
fix
1 parent db18100 commit c9926d4

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

ghcide/session-loader/Development/IDE/Session.hs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -893,13 +893,7 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir que = do
893893
checkInCache ncfp = runMaybeT $ do
894894
cachedHieYamlLocation <- MaybeT $ STM.lookup ncfp (filesMap sessionState)
895895
m <- MaybeT $ STM.lookup cachedHieYamlLocation (fileToFlags sessionState)
896-
-- Each one of deps will be registered as a FileSystemWatcher in the GhcSession action
897-
-- so that we can get a workspace/didChangeWatchedFiles notification when a dep changes.
898-
-- The GlobPattern of a FileSystemWatcher can be absolute or relative.
899-
-- We use the absolute one because it is supported by more LSP clients.
900-
-- Here we make sure deps are absolute and later we use those absolute deps as GlobPattern.
901-
let absolutePathsCradleDeps (eq, deps) = (eq, fmap toAbsolutePath deps)
902-
MaybeT $ pure $ absolutePathsCradleDeps <$> HM.lookup ncfp m
896+
MaybeT $ pure $ HM.lookup ncfp m
903897

904898
-- The main function which gets options for a file. We only want one of these running
905899
-- at a time. Therefore the IORef contains the currently running cradle, if we try
@@ -947,9 +941,16 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir que = do
947941
-- see Note [Serializing runs in separate thread]
948942
-- Start the getOptionsLoop if the queue is empty
949943
liftIO $ atomically $ Extra.whenM (isEmptyTQueue que) $ writeTQueue que getOptionsLoop
944+
945+
-- Each one of deps will be registered as a FileSystemWatcher in the GhcSession action
946+
-- so that we can get a workspace/didChangeWatchedFiles notification when a dep changes.
947+
-- The GlobPattern of a FileSystemWatcher can be absolute or relative.
948+
-- We use the absolute one because it is supported by more LSP clients.
949+
-- Here we make sure deps are absolute and later we use those absolute deps as GlobPattern.
950+
let absolutePathsCradleDeps (eq, deps) = (eq, fmap toAbsolutePath $ Map.keys deps)
950951
returnWithVersion $ \file -> do
951952
let absFile = toAbsolutePath file
952-
second Map.keys <$> lookupOrWaitCache absFile
953+
absolutePathsCradleDeps <$> lookupOrWaitCache absFile
953954

954955
-- | Run the specific cradle on a specific FilePath via hie-bios.
955956
-- This then builds dependencies or whatever based on the cradle, gets the

0 commit comments

Comments
 (0)