protected override Func <GeneratorServices> GeneratorServicesProvider(Project project) { IVisualStudioTracer tracer = VsxHelper.ResolveMefDependency <IVisualStudioTracer>(ServiceProvider.GlobalProvider); IntegrationOptionsProvider = VsxHelper.ResolveMefDependency <IIntegrationOptionsProvider>(ServiceProvider.GlobalProvider); return(() => new VsGeneratorServices(project, new VsSpecFlowConfigurationReader(project, tracer), tracer, IntegrationOptionsProvider)); }
// new TestGeneratorFactory(), //TODO: load through DI // false) // { // this.project = project; // this.configurationReader = new VsSpecFlowConfigurationReader(); //TODO: load through DI // } public VsGeneratorServices(Project project, IVisualStudioTracer visualStudioTracer) : base( new TestGeneratorFactory(), //TODO: load through DI new RemoteAppDomainTestGeneratorFactory(tracer), //TODO: load through DI new VsGeneratorInfoProvider(project, tracer, configurationReader), //TODO: load through DI tracer, false) { this.configurationReader = configurationReader; }
public GherkinLanguageService(IProjectScope projectScope, IVisualStudioTracer visualStudioTracer) { this.projectScope = projectScope; this.visualStudioTracer = visualStudioTracer; AnalyzingEnabled = projectScope.GherkinScopeAnalyzer != null; visualStudioTracer.Trace("Language service created", "GherkinLanguageService"); }
public NoProjectScope(GherkinFileEditorClassifications classifications, IVisualStudioTracer visualStudioTracer) { GherkinTextBufferParser = new GherkinTextBufferParser(this, visualStudioTracer); GherkinProcessingScheduler = new GherkinProcessingScheduler(visualStudioTracer); SpecFlowProjectConfiguration = new SpecFlowProjectConfiguration(); GherkinDialectServices = new GherkinDialectServices(SpecFlowProjectConfiguration.GeneratorConfiguration.FeatureLanguage); Classifications = classifications; }
public GherkinLanguageService(IProjectScope projectScope, IVisualStudioTracer visualStudioTracer, bool enableStepMatchColoring) { this.projectScope = projectScope; this.visualStudioTracer = visualStudioTracer; this.enableStepMatchColoring = enableStepMatchColoring && projectScope.StepSuggestionProvider != null; AnalyzingEnabled = projectScope.GherkinScopeAnalyzer != null; visualStudioTracer.Trace("Language service created", "GherkinLanguageService"); }
public VsProjectFileTracker(Project project, string fileName, DteWithEvents dteWithEvents, IVisualStudioTracer tracer, bool followTrackingAfterRename = false) : base(project, dteWithEvents, tracer) { this.followTrackingAfterRename = followTrackingAfterRename; this.fileName = fileName; SetLastChangeDate(VsxHelper.FindProjectItemByProjectRelativePath(project, fileName)); SubscribeToDteEvents(); }
public NoProjectScope(GherkinFileEditorClassifications classifications, IVisualStudioTracer visualStudioTracer, IIntegrationOptionsProvider integrationOptionsProvider) { GherkinTextBufferParser = new GherkinTextBufferParser(this, visualStudioTracer); GherkinProcessingScheduler = new GherkinProcessingScheduler(visualStudioTracer, false); SpecFlowConfiguration = ConfigurationLoader.GetDefault(); GherkinDialectServices = new GherkinDialectServices(SpecFlowConfiguration.FeatureLanguage); Classifications = classifications; IntegrationOptionsProvider = integrationOptionsProvider; Tracer = visualStudioTracer; }
public VsProjectFileTracker(Project project, string fileName, DteWithEvents dteWithEvents, IVisualStudioTracer visualStudioTracer, bool followTrackingAfterRename = false) { this.project = project; this.followTrackingAfterRename = followTrackingAfterRename; this.fileName = fileName; this.visualStudioTracer = visualStudioTracer; SetLastChangeDate(VsxHelper.FindProjectItemByProjectRelativePath(project, fileName)); SubscribeToDteEvents(dteWithEvents); }
public GherkinProcessingScheduler(IVisualStudioTracer visualStudioTracer) { this.visualStudioTracer = visualStudioTracer; parsingDispatcher = CreateBackgroundThreadWithDispatcher(ThreadPriority.BelowNormal); parsingScheduler = new DispatcherScheduler(parsingDispatcher); parsingSubject = new Subject<IGherkinProcessingTask>(parsingScheduler); parsingSubject.BufferWithTimeout(parsingDelay, parsingScheduler, flushFirst: true) .Subscribe(ApplyTask); analyzingSubject = new Subject<IGherkinProcessingTask>(parsingScheduler); //TODO: create separate thread? analyzingSubject.BufferWithTimeout(analyzingDelay, parsingScheduler, flushFirst: false) .Subscribe(ApplyTask); }
public GherkinProcessingScheduler(IVisualStudioTracer visualStudioTracer) { this.visualStudioTracer = visualStudioTracer; parsingDispatcher = CreateBackgroundThreadWithDispatcher(ThreadPriority.BelowNormal); parsingScheduler = new DispatcherScheduler(parsingDispatcher); parsingSubject = new Subject <IGherkinProcessingTask>(parsingScheduler); parsingSubject.BufferWithTimeout(parsingDelay, parsingScheduler, flushFirst: true) .Subscribe(ApplyTask); analyzingSubject = new Subject <IGherkinProcessingTask>(parsingScheduler); //TODO: create separate thread? analyzingSubject.BufferWithTimeout(analyzingDelay, parsingScheduler, flushFirst: false) .Subscribe(ApplyTask); }
public GherkinFileEditorParser(ITextBuffer buffer, IClassificationTypeRegistryService registry, IVisualStudioTracer visualStudioTracer, SpecFlowProject specFlowProject) { this.buffer = buffer; this.visualStudioTracer = visualStudioTracer; this.specFlowProject = specFlowProject; this.buffer.Changed += BufferChanged; this.classifications = new GherkinFileEditorClassifications(registry); // initial parsing visualStudioTracer.Trace("Initial parsing scheduled", ParserTraceCategory); ChangeInfo changeInfo = new ChangeInfo(buffer); parsingTask = parsingTaskFactory.StartNew(() => ParseAndTriggerChanges(GherkinFileEditorInfo, changeInfo)); }
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); }
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, integrationOptionsProvider); }
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; }
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; }
protected override string GenerateCode(string inputFileContent) { IVisualStudioTracer tracer = VsxHelper.ResolveMefDependency <IVisualStudioTracer>(ServiceProvider.GlobalProvider); var generatorServices = new VsGeneratorServices(CurrentProject, new VsSpecFlowConfigurationReader(CurrentProject, tracer), tracer); using (var testGenerator = generatorServices.CreateTestGenerator()) { string projectFolder = VsxHelper.GetProjectFolder(CurrentProject); var fullPath = Path.GetFullPath(Path.Combine(projectFolder, CodeFilePath)); FeatureFileInput featureFileInput = new FeatureFileInput(FileSystemHelper.GetRelativePath(fullPath, projectFolder)) { FeatureFileContent = inputFileContent }; generationResult = testGenerator.GenerateTestFile(featureFileInput, new GenerationSettings()); if (!generationResult.Success) { return(null); } return(generationResult.GeneratedTestCode); } }
public VsProjectFileTracker(ProjectItem projectItem, DteWithEvents dteWithEvents, IVisualStudioTracer visualStudioTracer, bool followTrackingAfterRename = false) : this(projectItem.ContainingProject, VsxHelper.GetProjectRelativePath(projectItem), dteWithEvents, visualStudioTracer, followTrackingAfterRename) { }
public GherkinScopeAnalyzer(IProjectScope projectScope, IVisualStudioTracer visualStudioTracer) { this.projectScope = projectScope; this.visualStudioTracer = visualStudioTracer; }
public static GherkinFileEditorParser GetParser(ITextBuffer buffer, IClassificationTypeRegistryService classificationRegistry, IVisualStudioTracer visualStudioTracer, SpecFlowProject specFlowProject) { return buffer.Properties.GetOrCreateSingletonProperty(() => new GherkinFileEditorParser(buffer, classificationRegistry, visualStudioTracer, specFlowProject)); }
public DelegateTask(Action task, IVisualStudioTracer visualStudioTracer) { this.task = task; this.visualStudioTracer = visualStudioTracer; }
protected VsRemoteGeneratorServices(ITestGeneratorFactory testGeneratorFactory, bool enableSettingsCache, Project project, IVisualStudioTracer visualStudioTracer) : base(testGeneratorFactory, visualStudioTracer, enableSettingsCache) { this.project = project; }
public VsProjectFilesTracker(Project project, string regexPattern, DteWithEvents dteWithEvents, IVisualStudioTracer visualStudioTracer) : base(project, dteWithEvents, visualStudioTracer) { fileNameRe = new Regex(regexPattern, RegexOptions.IgnoreCase); SubscribeToDteEvents(); }
public GherkinTextBufferParser(IProjectScope projectScope, IVisualStudioTracer visualStudioTracer) { this.projectScope = projectScope; this.visualStudioTracer = visualStudioTracer; }
protected VsProjectFileTrackerBase(Project project, DteWithEvents dteWithEvents, IVisualStudioTracer visualStudioTracer) { this.project = project; this.dteWithEvents = dteWithEvents; this.visualStudioTracer = visualStudioTracer; }
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); }