protected override ImmutableArray <NamespaceOrTypeAndUsingDirective> GetConsolidatedUsings()
        {
            var currentSubmissionUsings = this.Compilation.GetSubmissionImports().Usings;

            // find the first preceding non-empty submission (has InteractiveUsingsBinder):
            CSharpCompilation       previous       = this.Compilation.PreviousSubmission;
            InteractiveUsingsBinder previousBinder = null;

            while (previous != null && previousBinder == null)
            {
                previousBinder = previous.GetInteractiveUsingsBinder();
                previous       = previous.PreviousSubmission;
            }

            if (previousBinder != null)
            {
                // TODO (tomat):
                // optimization: do this only if additional references are added to the submission:
                return(RebindAndAddUsings(previousBinder.ConsolidatedUsings, currentSubmissionUsings));
            }

            return(currentSubmissionUsings);
        }