packages feed

ollama-holes-plugin 0.1.2.0 → 0.1.3.0

raw patch · 3 files changed

+13/−5 lines, 3 filesdep +exceptionsPVP ok

version bump matches the API change (PVP)

Dependencies added: exceptions

API changes (from Hackage documentation)

Files

README.md view
@@ -51,11 +51,13 @@         main :: IO () (bound at Main.hs:12:1)       Valid hole fits include         map show-        map (\x -> "Number: " ++ show x)-        (\xs -> map (\x -> "Element: " ++ show x) xs)-        (\xs -> concatMap (\x -> ["Element: " ++ show x]) xs)+        Prelude.map show+        (\xs -> map show xs)+        (\xs -> [show x | x <- xs])+        (\xs -> concatMap (return . show) xs)    | 12 | main = do let k = (_b :: [Int] -> [String])+   |                    ^^ ```  ## Installation
ollama-holes-plugin.cabal view
@@ -20,7 +20,7 @@ -- PVP summary:     +-+------- breaking API changes --                  | | +----- non-breaking API additions --                  | | | +--- code changes with no API change-version:            0.1.2.0+version:            0.1.3.0  -- A short (one-line) description of the package. synopsis: A typed-hole plugin that uses LLMs to generate valid hole-fits@@ -129,6 +129,7 @@                       req ^>= 3.13,                       modern-uri ^>= 0.3,                       aeson ^>= 2.2,+                      exceptions ^>= 0.10       -- Directories containing source files.
src/GHC/Plugin/OllamaHoles.hs view
@@ -19,6 +19,7 @@ import GHC.Plugin.OllamaHoles.Backend.Ollama (ollamaBackend) import GHC.Plugin.OllamaHoles.Backend.OpenAI (openAICompatibleBackend) +import Control.Monad.Catch (handleAll) import GHC (GhcPs, LHsExpr) import GHC.Data.StringBuffer qualified as GHC (stringToStringBuffer) import GHC.Driver.Config.Parser qualified as GHC (initParserOpts)@@ -170,7 +171,7 @@                         showPprUnsafe $                             GHC.getPsErrorMessages st             return False-        GHC.POk _ (p_e :: LHsExpr GhcPs) -> do+        GHC.POk _ (p_e :: LHsExpr GhcPs) -> handleAll falseOnErr $ do             -- If parsing was successful, we try renaming the expression             (rn_e, free_vars) <- GHC.rnLExpr p_e             when debug $@@ -188,6 +189,10 @@                     putStrLn $                         showPprUnsafe wrapper             return does_fit+  where+    falseOnErr e = liftIO $ do+        when debug $ print e+        return False verifyHoleFit _ _ _ = return False  -- | Preprocess the response to remove empty lines, lines with only spaces, and code blocks