/// <inheritdoc /> public async Task <bool?> TryEvaluateModuleAsync([NotNull] IEvaluationScheduler scheduler, [NotNull] ModuleDefinition module, QualifierId qualifierId) { // Abstraction between SDK/Workspace/Core/Resolvers is broken here... var moduleDefinition = (ModuleDefinition)module; if (!string.Equals(moduleDefinition.Descriptor.ResolverName, Name, StringComparison.Ordinal)) { return(null); } var downloadData = m_workspaceResolver.Downloads[module.Descriptor.Name]; // Make sure evaluating is guarded by the semaphore, so it only happens one at a time // There is no need to make sure we don't evaluate duplicate work here since module evaluation // happens once per qualifier. await m_evaluationSemaphore.WaitAsync(); try { // Modules of the download resolver are always instantiated with the empty qualifier var moduleRegistry = (ModuleRegistry)m_frontEndHost.ModuleRegistry; var moduleLiteral = moduleRegistry .GetUninstantiatedModuleInfoByPath(downloadData.ModuleSpecFile) .FileModuleLiteral .InstantiateFileModuleLiteral(moduleRegistry, QualifierValue.CreateEmpty(m_context.QualifierTable)); // Evaluate all values of the module using (var contextTree = new ContextTree( m_frontEndHost, m_context, m_logger, m_evaluationStatistics, new QualifierValueCache(), isBeingDebugged: false, decorator: null, moduleLiteral, new EvaluatorConfiguration(trackMethodInvocations: false, cycleDetectorStartupDelay: TimeSpanUtilities.MillisecondsToTimeSpan(10)), scheduler, FileType.Project)) { var moduleTracker = VisitedModuleTracker.Create(isDebug: false); var success = await moduleLiteral.EvaluateAllAsync(contextTree.RootContext, moduleTracker, ModuleEvaluationMode.None); return(success); } } finally { m_evaluationSemaphore.Release(); } }