From 3fc6bee1a1359a68b77a6f11ed70bdcb88027da2 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Thu, 3 Oct 2024 11:13:13 -0600 Subject: Change the UnitInterface to have uncoupled Metadata. As opposed to the original 'Annotated' data type. --- src/Language/Fiddle/Compiler/ImportResolution.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/Language/Fiddle/Compiler/ImportResolution.hs') diff --git a/src/Language/Fiddle/Compiler/ImportResolution.hs b/src/Language/Fiddle/Compiler/ImportResolution.hs index 4f076b8..aacf27e 100644 --- a/src/Language/Fiddle/Compiler/ImportResolution.hs +++ b/src/Language/Fiddle/Compiler/ImportResolution.hs @@ -218,8 +218,9 @@ getImportResolutionState parseFile compileToChecked flags unit = do then doFullCompile else return val Left err -> do - tell [Diagnostic Error err srcSpan] - MaybeT $ return Nothing + tell [Diagnostic Warning "Doing recompile" srcSpan] + tell [Diagnostic Warning err srcSpan] + doFullCompile else doFullCompile addDependency path unitInterface = @@ -254,7 +255,8 @@ getImportResolutionState parseFile compileToChecked flags unit = do findFileInImportPath :: SourceSpan -> [FilePath] -> FilePath -> Compl FilePath findFileInImportPath sourceSpan paths path = do - realPaths <- lift2 $ filterM doesFileExist (map (++ ("/" ++ path)) paths) + canonicalPaths <- lift2 $ mapM (canonicalizePath . (++ ("/" ++ path))) paths + realPaths <- lift2 $ filterM doesFileExist canonicalPaths case realPaths of [] -> do -- cgit