public static IProjectWithIntellisense ImplementGetExternalErrorReporter(IVsReportExternalErrors reportExternalErrorsReporter)
        {
            var project = new Mock <IVsIntellisenseProject>();

            project.Setup(h => h.GetExternalErrorReporter(out reportExternalErrorsReporter))
            .Returns(0);

            var mock = new Mock <IProjectWithIntellisense>();

            mock.SetupGet(h => h.IntellisenseProject)
            .Returns(project.Object);

            return(mock.Object);
        }
Example #2
0
        public AbstractProject(
            VisualStudioProjectTracker projectTracker,
            Func<ProjectId, IVsReportExternalErrors> reportExternalErrorCreatorOpt,
            string projectSystemName,
            IVsHierarchy hierarchy,
            string language,
            IServiceProvider serviceProvider,
            MiscellaneousFilesWorkspace miscellaneousFilesWorkspaceOpt,
            VisualStudioWorkspaceImpl visualStudioWorkspaceOpt,
            HostDiagnosticUpdateSource hostDiagnosticUpdateSourceOpt)
        {
            Contract.ThrowIfNull(projectSystemName);

            _language = language;
            this.ServiceProvider = serviceProvider;
            _hierarchy = hierarchy;

            var componentModel = (IComponentModel)serviceProvider.GetService(typeof(SComponentModel));

            _contentTypeRegistryService = componentModel.GetService<IContentTypeRegistryService>();
            this.RunningDocumentTable = (IVsRunningDocumentTable4)serviceProvider.GetService(typeof(SVsRunningDocumentTable));

            this.DisplayName = _projectSystemName;
            _projectSystemName = projectSystemName;
            this.ProjectTracker = projectTracker;
            _miscellaneousFilesWorkspaceOpt = miscellaneousFilesWorkspaceOpt;
            _visualStudioWorkspaceOpt = visualStudioWorkspaceOpt;
            _hostDiagnosticUpdateSourceOpt = hostDiagnosticUpdateSourceOpt;

            UpdateProjectDisplayNameAndFilePath();

            if (_filePathOpt != null)
            {
                _version = VersionStamp.Create(File.GetLastWriteTimeUtc(_filePathOpt));
            }
            else
            {
                _version = VersionStamp.Create();
            }

            _id = this.ProjectTracker.GetOrCreateProjectIdForPath(_filePathOpt ?? _projectSystemName, _projectSystemName);
            if (reportExternalErrorCreatorOpt != null)
            {
                _externalErrorReporter = reportExternalErrorCreatorOpt(_id);
            }

            if (visualStudioWorkspaceOpt != null)
            {
                this.EditAndContinueImplOpt = new VsENCRebuildableProjectImpl(this);
            }

            ConnectHierarchyEvents();

            SetIsWebstite(hierarchy);
        }
 public int GetExternalErrorReporter(out IVsReportExternalErrors ppErrorReporter)
 {
     // TODO: Handle the error reporter
     ppErrorReporter = null;
     return(VSConstants.E_NOTIMPL);
 }
 public int GetExternalErrorReporter(out IVsReportExternalErrors ppErrorReporter)
 {
     // TODO: Handle the error reporter
     ppErrorReporter = null;
     return VSConstants.E_NOTIMPL;
 }