From 4def562179fbda231a22c3f39a8c9c38c0a6b8c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Tue, 12 Aug 2014 21:20:36 +0200 Subject: [PATCH] Add version number to symbol table cache filename --- Language/Haskell/GhcMod/Find.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Language/Haskell/GhcMod/Find.hs b/Language/Haskell/GhcMod/Find.hs index b923917..37d10c6 100644 --- a/Language/Haskell/GhcMod/Find.hs +++ b/Language/Haskell/GhcMod/Find.hs @@ -59,8 +59,13 @@ newtype SymbolDb = SymbolDb (Map Symbol [ModuleString]) ---------------------------------------------------------------- +-- | When introducing incompatible changes to the 'symbolCache' file format +-- increment this version number. +symbolCacheVersion = 0 + +-- | Filename of the symbol table cache file. symbolCache :: String -symbolCache = "ghc-mod.cache" +symbolCache = "ghc-mod-"++ show symbolCacheVersion ++".cache" packageCache :: String packageCache = "package.cache" @@ -130,7 +135,6 @@ getSymbolCachePath = do -- if the file does not exist or is invalid. -- The file name is printed. --- TODO: Before releaseing add a version number to the name of the cache file dumpSymbol :: IOish m => GhcModT m String dumpSymbol = do dir <- getSymbolCachePath