Example #1
0
        internal VsProjectScope(Project project, DteWithEvents dteWithEvents, GherkinFileEditorClassifications classifications, IVisualStudioTracer visualStudioTracer, IIntegrationOptionsProvider integrationOptionsProvider, IBindingSkeletonProviderFactory bindingSkeletonProviderFactory)
        {
            Classifications                     = classifications;
            this.project                        = project;
            this.dteWithEvents                  = dteWithEvents;
            this.visualStudioTracer             = visualStudioTracer;
            this.integrationOptionsProvider     = integrationOptionsProvider;
            this.bindingSkeletonProviderFactory = bindingSkeletonProviderFactory;

            var integrationOptions = integrationOptionsProvider.GetOptions();

            parser = new GherkinTextBufferParser(this, visualStudioTracer);
//TODO: enable when analizer is implemented
//            if (integrationOptions.EnableAnalysis)
//                analyzer = new GherkinScopeAnalyzer(this, visualStudioTracer);

            GherkinProcessingScheduler = new GherkinProcessingScheduler(visualStudioTracer, integrationOptions.EnableAnalysis);
        }
Example #2
0
        internal VsProjectScope(Project project, DteWithEvents dteWithEvents, GherkinFileEditorClassifications classifications, IVisualStudioTracer visualStudioTracer)
        {
            Classifications         = classifications;
            this.project            = project;
            this.visualStudioTracer = visualStudioTracer;
            //TODO: register for file changes, etc.

            parser   = new GherkinTextBufferParser(this, visualStudioTracer);
            analyzer = new GherkinScopeAnalyzer(this, visualStudioTracer);
            GherkinProcessingScheduler = new GherkinProcessingScheduler(visualStudioTracer);

            specFlowProjectConfigurationReference = new SynchInitializedInstance <SpecFlowProjectConfiguration>(() =>
                                                                                                                DteProjectReader.LoadSpecFlowConfigurationFromDteProject(project) ?? new SpecFlowProjectConfiguration());
            gherkinDialectServicesReference = new SynchInitializedInstance <GherkinDialectServices>(() =>
                                                                                                    new GherkinDialectServices(SpecFlowProjectConfiguration.GeneratorConfiguration.FeatureLanguage));

            appConfigTracker              = new VsProjectFileTracker(project, "App.config", dteWithEvents, visualStudioTracer);
            appConfigTracker.FileChanged += AppConfigTrackerOnFileChanged;
        }
Example #3
0
        internal VsProjectScope(Project project, DteWithEvents dteWithEvents, GherkinFileEditorClassifications classifications, IVisualStudioTracer tracer, IIntegrationOptionsProvider integrationOptionsProvider)
        {
            Classifications    = classifications;
            this.project       = project;
            this.dteWithEvents = dteWithEvents;
            this.tracer        = tracer;
            this.integrationOptionsProvider = integrationOptionsProvider;

            var integrationOptions = integrationOptionsProvider.GetOptions();

            parser = new GherkinTextBufferParser(this, tracer);
//TODO: enable when analizer is implemented
//            if (integrationOptions.EnableAnalysis)
//                analyzer = new GherkinScopeAnalyzer(this, visualStudioTracer);

            GherkinProcessingScheduler = new GherkinProcessingScheduler(tracer, integrationOptions.EnableAnalysis);

            GeneratorServices = new VsGeneratorServices(project, new VsSpecFlowConfigurationReader(project, tracer), tracer);
        }
Example #4
0
        public ProjectScopeFactory()
        {
            dteReference = new SynchInitializedInstance <DteWithEvents>(
                () =>
            {
                var dtex = new DteWithEvents(VsxHelper.GetDte(ServiceProvider));
                dtex.SolutionEvents.AfterClosing += OnSolutionClosed;
                VisualStudioTracer.Trace("subscribed to solution closed " + Thread.CurrentThread.ManagedThreadId, "ProjectScopeFactory");
                return(dtex);
            });

            classificationsReference = new SynchInitializedInstance <GherkinFileEditorClassifications>(
                () => new GherkinFileEditorClassifications(ClassificationRegistry));

            projectScopeCache = new SynchronizedResultCache <Project, string, IProjectScope>(
                project => new VsProjectScope(project, dteReference.Value, classificationsReference.Value, VisualStudioTracer, IntegrationOptionsProvider, BindingSkeletonProviderFactory),
                VsxHelper.GetProjectUniqueId);

            noProjectScopeReference = new SynchInitializedInstance <NoProjectScope>(() =>
                                                                                    new NoProjectScope(classificationsReference.Value, VisualStudioTracer));
        }
Example #5
0
        public ProjectScopeFactory()
        {
            dteReference = new SynchInitializedInstance <DteWithEvents>(
                () =>
            {
                ContainerProvider.ObjectContainer.Resolve <InstallServices>().OnPackageUsed();        //TODO: find a better place
                var dtex = new DteWithEvents(VsxHelper.GetDte(ServiceProvider), VisualStudioTracer);
                dtex.SolutionEvents.AfterClosing += OnSolutionClosed;
                dtex.SolutionEventsListener.OnQueryUnloadProject += OnProjectClosed;
                VisualStudioTracer.Trace("subscribed to solution closed " + Thread.CurrentThread.ManagedThreadId, "ProjectScopeFactory");
                return(dtex);
            });

            classificationsReference = new SynchInitializedInstance <GherkinFileEditorClassifications>(
                () => new GherkinFileEditorClassifications(ClassificationRegistry));

            projectScopeCache = new SynchronizedResultCache <Project, string, IProjectScope>(
                project => new VsProjectScope(project, dteReference.Value, classificationsReference.Value, VisualStudioTracer, IntegrationOptionsProvider),
                VsxHelper.GetProjectUniqueId);

            noProjectScopeReference = new SynchInitializedInstance <NoProjectScope>(() =>
                                                                                    new NoProjectScope(classificationsReference.Value, VisualStudioTracer, IntegrationOptionsProvider));
        }