From 8007cd3627e6e429c9d62e00af7ddb9317bec8f9 Mon Sep 17 00:00:00 2001 From: Moritz Kiefer Date: Mon, 16 Dec 2019 10:59:07 +0100 Subject: [PATCH] Clarify version handling --- src/Development/IDE/Core/FileStore.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Development/IDE/Core/FileStore.hs b/src/Development/IDE/Core/FileStore.hs index 46a48d5f9..197a658f4 100644 --- a/src/Development/IDE/Core/FileStore.hs +++ b/src/Development/IDE/Core/FileStore.hs @@ -76,6 +76,7 @@ makeVFSHandle = do modifyVar_ vfsVar $ \(nextVersion, vfs) -> pure $ (nextVersion + 1, ) $ case content of Nothing -> Map.delete uri vfs + -- The second version number is only used in persistFileVFS which we do not use so we set it to 0. Just content -> Map.insert uri (VirtualFile nextVersion 0 (Rope.fromText content)) vfs } @@ -139,7 +140,7 @@ getModificationTimeRule vfs = alwaysRerun mbVirtual <- liftIO $ getVirtualFile vfs $ filePathToUri' file case mbVirtual of - Just (VirtualFile ver _ _) -> pure (Just $ BS.pack $ show ver, ([], Just $ VFSVersion ver)) + Just (virtualFileVersion -> ver) -> pure (Just $ BS.pack $ show ver, ([], Just $ VFSVersion ver)) Nothing -> liftIO $ fmap wrap (getModTime file') `catch` \(e :: IOException) -> do let err | isDoesNotExistError e = "File does not exist: " ++ file'