From 1a9af9f39e23a12bb1a4cc024fc1f21e04c40ead Mon Sep 17 00:00:00 2001 From: Dmitry Bushev Date: Thu, 15 Jul 2021 13:37:56 +0300 Subject: [PATCH] [release: nightly] Fix the compilation order (#1866) --- .../instrument/job/EnsureCompiledJob.scala | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/engine/runtime/src/main/scala/org/enso/interpreter/instrument/job/EnsureCompiledJob.scala b/engine/runtime/src/main/scala/org/enso/interpreter/instrument/job/EnsureCompiledJob.scala index ad77a7a02d..11e1b044ff 100644 --- a/engine/runtime/src/main/scala/org/enso/interpreter/instrument/job/EnsureCompiledJob.scala +++ b/engine/runtime/src/main/scala/org/enso/interpreter/instrument/job/EnsureCompiledJob.scala @@ -73,10 +73,10 @@ class EnsureCompiledJob(protected val files: Iterable[File]) val modules = files.flatMap { file => ctx.executionService.getContext.getModuleForFile(file).toScala } + val moduleCompilationStatus = modules.map(ensureCompiledModule) val modulesInScope = getModulesInScope.filterNot(m => modules.exists(_ == m)) - val moduleCompilationStatus = modules.map(ensureCompiledModule) - val scopeCompilationStatus = ensureCompiledScope(modulesInScope) + val scopeCompilationStatus = ensureCompiledScope(modulesInScope) (moduleCompilationStatus ++ scopeCompilationStatus).maxOption .getOrElse(CompilationStatus.Success) } @@ -439,12 +439,8 @@ class EnsureCompiledJob(protected val files: Iterable[File]) /** Get all modules in the current compiler scope. */ private def getModulesInScope(implicit ctx: RuntimeContext - ): Iterable[Module] = { - val topScope = ctx.executionService.getContext.getTopScope - val modulesInScope = topScope.getModules.asScala - val builtins = topScope.getBuiltins.getModule - modulesInScope ++ Seq(builtins) - } + ): Iterable[Module] = + ctx.executionService.getContext.getTopScope.getModules.asScala /** Get the module path for suggestions database indexing. *