private void InitializeBuildErrorReporter()
 {
     // We defer grabbing error reporter the until the first build event, because the language service is initialized asynchronously
     if (_languageServiceBuildErrorReporter == null)
     {
         _languageServiceBuildErrorReporter = (IVsLanguageServiceBuildErrorReporter2)_host.HostSpecificErrorReporter;
     }
 }
        internal IDEBuildLogger(IVsOutputWindowPane output, IVsHierarchy hierarchy, IVsLanguageServiceBuildErrorReporter2 errorReporter)
        {
            if (hierarchy == null)
            {
                throw new ArgumentNullException("hierarchy");
            }

            this.errorReporter    = errorReporter;
            this.outputWindowPane = output;
            this.hierarchy        = hierarchy;
            IOleServiceProvider site;

            Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure(hierarchy.GetSite(out site));
            this.serviceProvider = new Shell.ServiceProvider(site);
        }
        private void InitializeBuildErrorReporter()
        {
            // We defer grabbing error reporter the until the first build event, because the language service is initialized asynchronously
            if (_languageServiceBuildErrorReporter == null && ProjectsWithIntellisense.Count > 0)
            {
                var project = ProjectsWithIntellisense.First();

                // TODO: VB's IVsIntellisenseProject::GetExternalErrorReporter() does not return the correct instance which should be QIed from the inner IVbCompilerProject (BUG 1024166),
                // so this code works on C# only.
                IVsReportExternalErrors reportExternalErrors;
                if (project.Value.IntellisenseProject.GetExternalErrorReporter(out reportExternalErrors) == 0)
                {
                    _languageServiceBuildErrorReporter = reportExternalErrors as IVsLanguageServiceBuildErrorReporter2;
                }
            }
        }