public static GherkinEditorContext FromDocument(Document document, IGherkinLanguageServiceFactory gherkinLanguageServiceFactory) { var textView = VsxHelper.GetWpfTextView(VsxHelper.GetIVsTextView(document)); if (textView == null) return null; var languageService = gherkinLanguageServiceFactory.GetLanguageService(textView.TextBuffer); return new GherkinEditorContext(languageService, textView); }
public ICompletionSource TryCreateCompletionSource(ITextBuffer textBuffer) { if (!SpecFlowServices.GetOptions().EnableIntelliSense) { return(null); } return(new GherkinStepCompletionSource(textBuffer, SpecFlowServices, GherkinLanguageServiceFactory.GetLanguageService(textBuffer))); }
public ICompletionSource TryCreateCompletionSource(ITextBuffer textBuffer) { if (!IntegrationOptionsProvider.GetOptions().EnableIntelliSense) { return(null); } return(new GherkinStepCompletionSource(textBuffer, GherkinLanguageServiceFactory.GetLanguageService(textBuffer))); }
public IClassifier GetClassifier(ITextBuffer buffer) { if (!IntegrationOptionsProvider.GetOptions().EnableSyntaxColoring) { return(null); } return(GherkinBufferServiceManager.GetOrCreate(buffer, () => new GherkinFileClassifier(GherkinLanguageServiceFactory.GetLanguageService(buffer)))); }
public static GherkinEditorContext FromDocument(Document document, IGherkinLanguageServiceFactory gherkinLanguageServiceFactory) { var textView = VsxHelper.GetWpfTextView(VsxHelper.GetIVsTextView(document)); if (textView == null) { return(null); } var languageService = gherkinLanguageServiceFactory.GetLanguageService(textView.TextBuffer); return(new GherkinEditorContext(languageService, textView)); }
public ICompletionSource TryCreateCompletionSource(ITextBuffer textBuffer) { var options = IntegrationOptionsProvider.GetOptions(); if (!options.EnableIntelliSense) { return(null); } bool limitStepInstancesSuggestions = options.LimitStepInstancesSuggestions; int maxStepSuggestions = options.MaxStepInstancesSuggestions; return(new GherkinStepCompletionSource(textBuffer, GherkinLanguageServiceFactory.GetLanguageService(textBuffer), Tracer, limitStepInstancesSuggestions, maxStepSuggestions)); }
public void VsTextViewCreated(IVsTextView textViewAdapter) { IWpfTextView view = AdaptersFactory.GetWpfTextView(textViewAdapter); Debug.WriteLineIf(view != null, "No WPF editor view found"); if (view == null) { return; } var languageService = GherkinLanguageServiceFactory.GetLanguageService(view.TextBuffer); var commandFilter = new EditorCommandFilter(view, languageService); IOleCommandTarget next; textViewAdapter.AddCommandFilter(commandFilter, out next); commandFilter.Next = next; }
public void VsTextViewCreated(IVsTextView textViewAdapter) { IWpfTextView view = AdaptersFactory.GetWpfTextView(textViewAdapter); Debug.WriteLineIf(view != null, "No WPF editor view found"); if (view == null) { return; } var languageService = GherkinLanguageServiceFactory.GetLanguageService(view.TextBuffer); var editorContext = new GherkinEditorContext(languageService, view); var editorCommandFilter = ContainerProvider.ObjectContainer.Resolve <EditorCommandFilter>(); var commandFilter = new EditorCommandFilterInstance(editorCommandFilter, editorContext); IOleCommandTarget next; textViewAdapter.AddCommandFilter(commandFilter, out next); commandFilter.Next = next; }
public void VsTextViewCreated(IVsTextView textViewAdapter) { if (!IntegrationOptionsProvider.GetOptions().EnableIntelliSense) { return; } IWpfTextView view = AdaptersFactory.GetWpfTextView(textViewAdapter); Debug.WriteLineIf(view != null, "No WPF editor view found"); if (view == null) { return; } var languageService = GherkinLanguageServiceFactory.GetLanguageService(view.TextBuffer); var commandFilter = new GherkinCompletionCommandFilter(view, CompletionBroker, languageService, Tracer); IOleCommandTarget next; textViewAdapter.AddCommandFilter(commandFilter, out next); commandFilter.Next = next; }
public ITagger <T> CreateTagger <T>(ITextBuffer buffer) where T : ITag { if (!IntegrationOptionsProvider.GetOptions().EnableOutlining) { return(null); } return((ITagger <T>)GherkinBufferServiceManager.GetOrCreate(buffer, () => new GherkinFileOutliningTagger(GherkinLanguageServiceFactory.GetLanguageService(buffer)))); }