From 8dfba76f12fb98b2f4b61d6c25c49447d4f7aa54 Mon Sep 17 00:00:00 2001 From: Joseph Sumabat Date: Sun, 17 Sep 2023 22:46:01 -0400 Subject: [PATCH] Clarify error message and description for hiedb function --- src/StaticLS/HieDb.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/StaticLS/HieDb.hs b/src/StaticLS/HieDb.hs index ea443c0d..f246b44b 100644 --- a/src/StaticLS/HieDb.hs +++ b/src/StaticLS/HieDb.hs @@ -6,7 +6,8 @@ import Data.List (intercalate) import Database.SQLite.Simple import HieDb --- | Lookup 'HieModule' row from 'HieDb' given the path to the Haskell source file +-- | Lookup 'HieModule' row from 'HieDb' given the path to the Haskell hie file +-- A temporary function until this is supported in hiedb proper lookupHieFileFromHie :: HieDb -> FilePath -> IO (Maybe HieModuleRow) lookupHieFileFromHie (getConn -> conn) fp = do files <- query conn "SELECT * FROM mods WHERE hieFile = ?" (Only fp) @@ -15,7 +16,7 @@ lookupHieFileFromHie (getConn -> conn) fp = do [x] -> return $ Just x xs -> error $ - "DB invariant violated, hs_src in mods not unique: " + "DB invariant violated, hieFile in mods not unique: " ++ show fp ++ ". Entries: " ++ intercalate ", " (map (show . toRow) xs)