コード例 #1
0
        private void Initialize()
        {
            specFlowProjectConfiguration = LoadConfiguration();
            gherkinDialectServices       = new GherkinDialectServices(specFlowProjectConfiguration.GeneratorConfiguration.FeatureLanguage);

            appConfigTracker                 = new VsProjectFileTracker(project, "App.config", dteWithEvents, visualStudioTracer);
            appConfigTracker.FileChanged    += AppConfigTrackerOnFileChanged;
            appConfigTracker.FileOutOfScope += AppConfigTrackerOnFileOutOfScope;

            var enableAnalysis = integrationOptionsProvider.GetOptions().EnableAnalysis;

            if (enableAnalysis)
            {
                featureFilesTracker        = new ProjectFeatureFilesTracker(this);
                featureFilesTracker.Ready += FeatureFilesTrackerOnReady;

                bindingFilesTracker = new BindingFilesTracker(this);

                stepSuggestionProvider = new VsStepSuggestionProvider(this);
                bindingMatchService    = new BindingMatchService(stepSuggestionProvider);
            }
            initialized = true;

            if (enableAnalysis)
            {
                stepSuggestionProvider.Initialize();
                bindingFilesTracker.Initialize();
                featureFilesTracker.Initialize();
                bindingFilesTracker.Run();
                featureFilesTracker.Run();
            }
        }
コード例 #2
0
        private void InitializeJsonConfigTracker()
        {
            _tracer.Trace("Initializing file tracker for specflow.json ...", VsProjectScopeTraceCategory);

            _specflowJsonTracker                 = new VsProjectFileTracker(_project, "specflow.json", _dteWithEvents, _tracer);
            _specflowJsonTracker.FileChanged    += ConfigFileTrackerOnFileChanged;
            _specflowJsonTracker.FileOutOfScope += ConfigFileTrackerOnFileOutOfScope;

            _tracer.Trace("Initialized file tracker for specflow.json", VsProjectScopeTraceCategory);
        }
コード例 #3
0
        private void InitializeAppConfigTracker()
        {
            _tracer.Trace("Initializing file tracker for app.config ...", VsProjectScopeTraceCategory);

            _appConfigTracker                 = new VsProjectFileTracker(_project, "App.config", _dteWithEvents, _tracer);
            _appConfigTracker.FileChanged    += ConfigFileTrackerOnFileChanged;
            _appConfigTracker.FileOutOfScope += ConfigFileTrackerOnFileOutOfScope;

            _tracer.Trace("Initialized file tracker for app.config", VsProjectScopeTraceCategory);
        }
コード例 #4
0
        private void Initialize()
        {
            tracer.Trace("Initializing...", "VsProjectScope");
            try
            {
                specFlowProjectConfiguration = LoadConfiguration();
                gherkinDialectServices       = new GherkinDialectServices(specFlowProjectConfiguration.GeneratorConfiguration.FeatureLanguage);

                appConfigTracker                 = new VsProjectFileTracker(project, "App.config", dteWithEvents, tracer);
                appConfigTracker.FileChanged    += AppConfigTrackerOnFileChanged;
                appConfigTracker.FileOutOfScope += AppConfigTrackerOnFileOutOfScope;

                var enableAnalysis = integrationOptionsProvider.GetOptions().EnableAnalysis;
                if (enableAnalysis)
                {
                    featureFilesTracker        = new ProjectFeatureFilesTracker(this);
                    featureFilesTracker.Ready += FeatureFilesTrackerOnReady;

                    bindingFilesTracker = new BindingFilesTracker(this);

                    stepSuggestionProvider        = new VsStepSuggestionProvider(this);
                    stepSuggestionProvider.Ready += StepSuggestionProviderOnReady;
                    stepDefinitionMatchService    = new StepDefinitionMatchServiceWithOnlySimpleTypeConverter(stepSuggestionProvider, m_objectContainer, m_runtimeConfiguration);
                }
                tracer.Trace("Initialized", "VsProjectScope");
                initialized = true;

                if (enableAnalysis)
                {
                    tracer.Trace("Starting analysis services...", "VsProjectScope");

                    stepSuggestionProvider.Initialize();
                    bindingFilesTracker.Initialize();
                    featureFilesTracker.Initialize();

                    LoadStepMap();

                    bindingFilesTracker.Run();
                    featureFilesTracker.Run();

                    dteWithEvents.OnBuildDone += BuildEventsOnOnBuildDone;

                    tracer.Trace("Analysis services started", "VsProjectScope");
                }
                else
                {
                    tracer.Trace("Analysis services disabled", "VsProjectScope");
                }
            }
            catch (Exception exception)
            {
                tracer.Trace("Exception: " + exception, "VsProjectScope");
            }
        }
コード例 #5
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;
        }