Skip to content

Commit 80d0160

Browse files
committed
update hiebois
1 parent 78e01a8 commit 80d0160

File tree

3 files changed

+21
-22
lines changed

3 files changed

+21
-22
lines changed

cabal.project

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ packages:
88
./hls-test-utils
99

1010

11-
index-state: 2025-04-19T07:34:07Z
11+
index-state: 2025-04-26T07:34:07Z
1212

1313
tests: True
1414
test-show-details: direct
@@ -53,13 +53,6 @@ allow-newer:
5353
cabal-install-parsers:Cabal-syntax,
5454

5555

56-
source-repository-package
57-
type: git
58-
location: https://github.com/haskell/hie-bios
59-
tag: e372a62b780b1314a35238a698a9e3813096b122
60-
-- see https://github.com/haskell/haskell-language-server/pull/4445#issuecomment-2705787655
61-
allow-older: hie-bios:optparse-applicative
62-
6356
if impl(ghc >= 9.11)
6457
benchmarks: False
6558
allow-newer:

ghcide/ghcide.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ library
7373
, Glob
7474
, haddock-library >=1.8 && <1.12
7575
, hashable
76-
, hie-bios ^>=0.14.0
76+
, hie-bios ^>=0.15.0
7777
, hie-compat ^>=0.3.0.0
7878
, hiedb ^>= 0.6.0.2
7979
, hls-graph == 2.10.0.0

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

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,23 @@ completeFileProcessing state hieYaml ncfp file flags = do
500500
insertFileMapping state hieYaml ncfp
501501
removeFromPending state file
502502

503+
-- | Handle successful loading by updating session state with the new file maps
504+
updateSessionOnSuccess :: Recorder (WithPriority Log) -> SessionState -> Maybe FilePath -> HashMap NormalizedFilePath (IdeResult HscEnvEq, DependencyInfo) -> [TargetDetails] -> IO ()
505+
updateSessionOnSuccess recorder state hieYaml this_flags_map all_targets = do
506+
let newLoaded = Set.fromList $ fromNormalizedFilePath <$> HM.keys this_flags_map
507+
atomically $ do
508+
STM.insert this_flags_map hieYaml (fileToFlags state)
509+
insertAllFileMappings state $ map ((hieYaml,) . fst) $ concatMap toFlagsMap all_targets
510+
forM_ newLoaded $ flip S.delete (pendingFileSet state)
511+
pendingFiles <- getPendingFiles state
512+
let newLoaded = pendingFiles `Set.intersection` newLoaded
513+
-- log new loaded files
514+
logWith recorder Info $ LogSessionNewLoadedFiles $ Set.toList newLoaded
515+
-- remove all new loaded file from error loading files
516+
mapM_ (removeErrorLoadingFile state) (Set.toList newLoaded)
517+
addCradleFiles state newLoaded
518+
return ()
519+
503520
-- | Insert multiple file mappings at once
504521
insertAllFileMappings :: SessionState -> [(Maybe FilePath, NormalizedFilePath)] -> STM ()
505522
insertAllFileMappings state mappings =
@@ -711,11 +728,7 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir que = do
711728
Nothing
712729

713730
let newLoaded = Set.fromList $ fromNormalizedFilePath <$> HM.keys this_flags_map
714-
atomically $ do
715-
STM.insert this_flags_map hieYaml (fileToFlags sessionState)
716-
insertAllFileMappings sessionState $ map ((hieYaml,) . fst) $ concatMap toFlagsMap all_targets
717-
forM_ newLoaded $ flip S.delete (pendingFileSet sessionState)
718-
731+
updateSessionOnSuccess recorder sessionState hieYaml this_flags_map all_targets
719732
-- Typecheck all files in the project on startup
720733
checkProject <- getCheckProject
721734
-- The VFS doesn't change on cradle edits, re-use the old one.
@@ -769,14 +782,7 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir que = do
769782
[] -> error $ "GHC version could not be parsed: " <> version
770783
((runTime, _):_)
771784
| compileTime == runTime -> do
772-
(_results, allNewLoaded, restart) <- session (hieYaml, ncfp, opts, libDir)
773-
pendingFiles <- getPendingFiles sessionState
774-
let newLoaded = pendingFiles `Set.intersection` allNewLoaded
775-
-- log new loaded files
776-
logWith recorder Info $ LogSessionNewLoadedFiles $ Set.toList newLoaded
777-
-- remove all new loaded file from error loading files
778-
mapM_ (removeErrorLoadingFile sessionState) (Set.toList allNewLoaded)
779-
addCradleFiles sessionState newLoaded
785+
(_results, _allNewLoaded, restart) <- session (hieYaml, ncfp, opts, libDir)
780786
restart
781787
| otherwise -> do
782788
-- Use the common pattern here: updateFileState

0 commit comments

Comments
 (0)