private async Task <bool> ComputeHasSuccessfullyLoadedTransitivelyAsync(Solution solution, bool hasSuccessfullyLoaded, CancellationToken cancellationToken)
            {
                if (!hasSuccessfullyLoaded)
                {
                    return(false);
                }

                foreach (var projectReference in this.ProjectState.ProjectReferences)
                {
                    var project = solution.GetProject(projectReference.ProjectId);
                    if (project == null)
                    {
                        return(false);
                    }

                    if (!await solution.HasSuccessfullyLoadedAsync(project, cancellationToken).ConfigureAwait(false))
                    {
                        return(false);
                    }
                }

                return(true);
            }
Пример #2
0
 /// <summary>
 /// Determines if the compilation returned by <see cref="GetCompilationAsync"/> and all its referenced compilaton are from fully loaded projects.
 /// </summary>
 // TODO: make this public
 internal Task <bool> HasSuccessfullyLoadedAsync(CancellationToken cancellationToken = default(CancellationToken))
 {
     return(_solution.HasSuccessfullyLoadedAsync(this, cancellationToken));
 }
Пример #3
0
            private async Task<bool> ComputeHasSuccessfullyLoadedTransitivelyAsync(Solution solution, bool hasSuccessfullyLoaded, CancellationToken cancellationToken)
            {
                if (!hasSuccessfullyLoaded)
                {
                    return false;
                }

                foreach (var projectReference in this.ProjectState.ProjectReferences)
                {
                    var project = solution.GetProject(projectReference.ProjectId);
                    if (project == null)
                    {
                        return false;
                    }

                    if (!await solution.HasSuccessfullyLoadedAsync(project, cancellationToken).ConfigureAwait(false))
                    {
                        return false;
                    }
                }

                return true;
            }