diff --git a/src/Semantic/Util.hs b/src/Semantic/Util.hs index 2e7b1d438..1032abb89 100644 --- a/src/Semantic/Util.hs +++ b/src/Semantic/Util.hs @@ -176,17 +176,20 @@ evaluatePythonProjects proxy parser lang path = runTask' $ do (raiseHandler (runReader (lowerBound @Span)) (evaluate proxy (runDomainEffects (evalTerm withTermSpans)) modules))))))) -evaluateProjectForScopeGraph proxy parser project = runTaskWithOptions debugOptions $ do - package <- fmap quieterm <$> parsePythonPackage parser project - modules <- topologicalSort <$> runImportGraphToModules proxy package - trace $ "evaluating with load order: " <> show (map (modulePath . moduleInfo) modules) - pure (id @(Evaluator _ (Hole.Hole (Maybe Name) Precise) (Value _ (Hole.Hole (Maybe Name) Precise)) _ _) - (runModuleTable - (runModules (ModuleTable.modulePaths (packageModules package)) - (raiseHandler (runReader (packageInfo package)) - (raiseHandler (evalState (lowerBound @Span)) - (raiseHandler (runReader (lowerBound @Span)) - (evaluate proxy (runDomainEffects (evalTerm withTermSpans)) modules))))))) +evaluateProjectForScopeGraph proxy parser project = do + res <- runTaskWithOptions debugOptions $ do + package <- fmap quieterm <$> parsePythonPackage parser project + modules <- topologicalSort <$> runImportGraphToModules proxy package + trace $ "evaluating with load order: " <> show (map (modulePath . moduleInfo) modules) + pure (id @(Evaluator _ (Hole.Hole (Maybe Name) Precise) (Value _ (Hole.Hole (Maybe Name) Precise)) _ _) + (runModuleTable + (runModules (ModuleTable.modulePaths (packageModules package)) + (raiseHandler (runReader (packageInfo package)) + (raiseHandler (evalState (lowerBound @Span)) + (raiseHandler (runReader (lowerBound @Span)) + (evaluate proxy (runDomainEffects (evalTerm withTermSpans)) modules))))))) + either (die . displayException) pure res + evaluateProjectWithCaching proxy parser path = runTask' $ do project <- readProject Nothing path (Language.reflect proxy) []