diff --git a/src/LanguageServer/Handler/TextDocument.hs b/src/LanguageServer/Handler/TextDocument.hs index ac3ea045a..b72e69941 100644 --- a/src/LanguageServer/Handler/TextDocument.hs +++ b/src/LanguageServer/Handler/TextDocument.hs @@ -146,28 +146,30 @@ persistModules = do persistModule :: Module -> LSM () persistModule m = do - let generate = do - -- trace "Generating" $ return () - mld <- getLoaded - case mld of - Just loaded -> do - term <- getTerminal - flags <- getFlags - (loaded, file) <- liftIO $ codeGen term flags Object loaded{loadedModule = m} - putLoaded loaded - return () - Nothing -> return () - -- trace ("Module " ++ show (modName m)) $ - case modOutputTime m of - Nothing -> do - -- trace "No output time" $ return () - generate - -- If it has been 5 seconds since the last time the module was changed - -- and it isn't updated on disk persist again. - -- We don't do it all the time, because with virtual files and editor changes it would be too much - Just t -> do - ct <- liftIO getCurrentTime - when ((ct > addUTCTime 5 (modTime m)) && (modTime m > t)) $ do - -- trace ("Last output time" ++ show t) $ return () - generate - return () \ No newline at end of file + return () + -- TODO: This works, but needs to check that the dependencies are persisted first. + -- let generate = do + -- -- trace "Generating" $ return () + -- mld <- getLoaded + -- case mld of + -- Just loaded -> do + -- term <- getTerminal + -- flags <- getFlags + -- (loaded, file) <- liftIO $ codeGen term flags Object loaded{loadedModule = m} + -- putLoaded loaded + -- return () + -- Nothing -> return () + -- -- trace ("Module " ++ show (modName m)) $ + -- case modOutputTime m of + -- Nothing -> do + -- -- trace "No output time" $ return () + -- generate + -- -- If it has been 5 seconds since the last time the module was changed + -- -- and it isn't updated on disk persist again. + -- -- We don't do it all the time, because with virtual files and editor changes it would be too much + -- Just t -> do + -- ct <- liftIO getCurrentTime + -- when ((ct > addUTCTime 5 (modTime m)) && (modTime m > t)) $ do + -- -- trace ("Last output time" ++ show t) $ return () + -- generate + -- return () \ No newline at end of file