Ejemplo n.º 1
0
        public ICompletionSource TryCreateCompletionSource(ITextBuffer textBuffer)
        {
            if (!SpecFlowServices.GetOptions().EnableIntelliSense)
            {
                return(null);
            }

            return(new GherkinStepCompletionSource(textBuffer, SpecFlowServices, GherkinLanguageServiceFactory.GetLanguageService(textBuffer)));
        }
Ejemplo n.º 2
0
        public IClassifier GetClassifier(ITextBuffer buffer)
        {
            if (!SpecFlowServices.GetOptions().EnableSyntaxColoring)
            {
                return(null);
            }

            return(GherkinBufferServiceManager.GetOrCreate(buffer, () =>
                                                           new GherkinFileClassifier(GherkinLanguageServiceFactory.GetLanguageService(buffer))));
        }
Ejemplo n.º 3
0
        public ITagger <T> CreateTagger <T>(ITextBuffer buffer) where T : ITag
        {
            if (!SpecFlowServices.GetOptions().EnableOutlining)
            {
                return(null);
            }

            return((ITagger <T>)GherkinBufferServiceManager.GetOrCreate(buffer, () =>
                                                                        new GherkinFileOutliningTagger(GherkinLanguageServiceFactory.GetLanguageService(buffer))));
        }
        public void VsTextViewCreated(IVsTextView textViewAdapter)
        {
            if (!SpecFlowServices.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);

            IOleCommandTarget next;

            textViewAdapter.AddCommandFilter(commandFilter, out next);
            commandFilter.Next = next;
        }