Skip to content

Commit 816043c

Browse files
committed
getDatabaseKeys
1 parent ad1fb0d commit 816043c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

hls-graph/src/Development/IDE/Graph/Database.hs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module Development.IDE.Graph.Database(
99
shakeRunDatabaseForKeys,
1010
shakeProfileDatabase,
1111
shakeGetBuildStep,
12+
shakeGetDatabaseKeys,
1213
shakeGetDirtySet,
1314
shakeGetCleanKeys
1415
,shakeGetBuildEdges) where
@@ -79,3 +80,8 @@ shakeGetBuildEdges (ShakeDatabase _ _ db) = do
7980
keys <- getDatabaseValues db
8081
let ress = mapMaybe (getResult . snd) keys
8182
return $ sum $ map (length . getResultDepsDefault [] . resultDeps) ress
83+
84+
-- | Returns an approximation of the database keys,
85+
-- annotated with how long ago (in # builds) they were visited
86+
shakeGetDatabaseKeys :: ShakeDatabase -> IO [(Key, Int)]
87+
shakeGetDatabaseKeys (ShakeDatabase _ _ db) = getKeysAndVisitAge db

hls-graph/src/Development/IDE/Graph/Internal/Database.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ getDirtySet db = do
199199
calcAgeStatus _ = Nothing
200200
return $ mapMaybe (secondM calcAgeStatus) dbContents
201201

202-
-- | Returns ann approximation of the database keys,
202+
-- | Returns an approximation of the database keys,
203203
-- annotated with how long ago (in # builds) they were visited
204204
getKeysAndVisitAge :: Database -> IO [(Key, Int)]
205205
getKeysAndVisitAge db = do

0 commit comments

Comments
 (0)