Skip to content

Commit

Permalink
fix missing highlighting on error
Browse files Browse the repository at this point in the history
  • Loading branch information
janmasrovira committed Aug 21, 2024
1 parent 9bbf264 commit 20af395
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/Juvix/Compiler/Concrete/Print/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,6 @@ instance (SingI s) => PrettyPrint (DoubleBracesExpression s) where
instance (SingI s) => PrettyPrint (DoLet s) where
ppCode DoLet {..} = do
let letFunDefs' = blockIndent (ppBlock _doLetStatements)
-- blockIndent d = hardline <> indent d <> line
ppCode _doLetKw
<> letFunDefs'
<> ppCode _doLetInKw
Expand Down
11 changes: 6 additions & 5 deletions src/Juvix/Compiler/Pipeline/Driver.hs
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ processModule = cacheGet

evalModuleInfoCache ::
forall r a.
(Members '[TaggedLock, TopModuleNameChecker, Error JuvixError, Files, PathResolver] r) =>
(Members '[TaggedLock, HighlightBuilder, TopModuleNameChecker, Error JuvixError, Files, PathResolver] r) =>
Sem (ModuleInfoCache ': JvoCache ': r) a ->
Sem r a
evalModuleInfoCache = evalJvoCache . evalCacheEmpty processModuleCacheMiss

-- | Used for parallel compilation
evalModuleInfoCacheSetup ::
forall r a.
(Members '[TaggedLock, TopModuleNameChecker, Error JuvixError, Files, PathResolver] r) =>
(Members '[TaggedLock, HighlightBuilder, TopModuleNameChecker, Error JuvixError, Files, PathResolver] r) =>
(EntryIndex -> Sem (ModuleInfoCache ': JvoCache ': r) ()) ->
Sem (ModuleInfoCache ': JvoCache ': r) a ->
Sem r a
Expand All @@ -75,6 +75,7 @@ processModuleCacheMiss ::
( Members
'[ ModuleInfoCache,
TaggedLock,
HighlightBuilder,
TopModuleNameChecker,
Error JuvixError,
Files,
Expand Down Expand Up @@ -240,7 +241,7 @@ processImports imports = do

processModuleToStoredCore ::
forall r.
(Members '[ModuleInfoCache, PathResolver, TopModuleNameChecker, Error JuvixError, Files] r) =>
(Members '[ModuleInfoCache, PathResolver, HighlightBuilder, TopModuleNameChecker, Error JuvixError, Files] r) =>
Text ->
EntryPoint ->
Sem r (PipelineResult Store.ModuleInfo)
Expand All @@ -262,10 +263,10 @@ processModuleToStoredCore sha256 entry = over pipelineResult mkModuleInfo <$> pr

processFileToStoredCore ::
forall r.
(Members '[ModuleInfoCache, PathResolver, TopModuleNameChecker, Error JuvixError, Files] r) =>
(Members '[ModuleInfoCache, HighlightBuilder, PathResolver, TopModuleNameChecker, Error JuvixError, Files] r) =>
EntryPoint ->
Sem r (PipelineResult Core.CoreResult)
processFileToStoredCore entry = ignoreHighlightBuilder . runReader entry $ do
processFileToStoredCore entry = runReader entry $ do
res <- processFileUpToParsing entry
let pkg = entry ^. entryPointPackage
mid <- runReader pkg (getModuleId (res ^. pipelineResult . Parser.resultModule . modulePath . to topModulePathKey))
Expand Down
2 changes: 2 additions & 0 deletions src/Juvix/Compiler/Pipeline/DriverParallel.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ where

import Data.HashMap.Strict qualified as HashMap
import Effectful.Concurrent
import Juvix.Compiler.Concrete.Data.Highlight.Builder (HighlightBuilder)
import Juvix.Compiler.Concrete.Language
import Juvix.Compiler.Concrete.Translation.FromSource.TopModuleNameChecker
import Juvix.Compiler.Concrete.Translation.ImportScanner (ImportScanStrategy)
Expand Down Expand Up @@ -151,6 +152,7 @@ evalModuleInfoCache ::
forall r a.
( Members
'[ Reader EntryPoint,
HighlightBuilder,
IOE,
ProgressLog,
Reader ImportTree,
Expand Down
1 change: 1 addition & 0 deletions src/Juvix/Compiler/Pipeline/Repl.hs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ compileReplInputIO fp txt = do
. runLoggerIO defaultLoggerOptions
. runReader defaultNumThreads
. evalInternet hasInternet
. ignoreHighlightBuilder
. runTaggedLockPermissive
. runLogIO
. runFilesIO
Expand Down
1 change: 1 addition & 0 deletions src/Juvix/Compiler/Pipeline/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ evalModuleInfoCacheHelper ::
TaggedLock,
TopModuleNameChecker,
Error JuvixError,
HighlightBuilder,
PathResolver,
Reader ImportScanStrategy,
Reader NumThreads,
Expand Down

0 comments on commit 20af395

Please sign in to comment.