예제 #1
0
        public GherkinFileClassifier(ITextBuffer buffer)
        {
            var snapshot = buffer.CurrentSnapshot;
            _spans = new List<ClassificationSpan>();
            _listeners = new CompositeDisposable();

            _parser = buffer.Properties.GetProperty<GherkinFileEditorParser>(typeof(GherkinFileEditorParser));

            _listeners.Add(_parser.IsParsing.Where(isParsing => isParsing).Subscribe(b => _spans.Clear()));
            _listeners.Add(_parser.IsParsing.Where(isParsing => !isParsing).Subscribe(b => PublishClassificationEvents()));

            _listeners.Add(_parser
                            .ParserEvents
                            .Select(f => SelectClassifiable(f, snapshot))
                            .Subscribe((spans => _spans.AddRange(spans))));
        }
예제 #2
0
        public GherkinFileClassifier(ITextBuffer buffer)
        {
            var snapshot = buffer.CurrentSnapshot;

            _spans     = new List <ClassificationSpan>();
            _listeners = new CompositeDisposable();

            _parser = buffer.Properties.GetProperty <GherkinFileEditorParser>(typeof(GherkinFileEditorParser));

            _listeners.Add(_parser.IsParsing.Where(isParsing => isParsing).Subscribe(b => _spans.Clear()));
            _listeners.Add(_parser.IsParsing.Where(isParsing => !isParsing).Subscribe(b => PublishClassificationEvents()));

            _listeners.Add(_parser
                           .ParserEvents
                           .Select(f => SelectClassifiable(f, snapshot))
                           .Subscribe((spans => _spans.AddRange(spans))));
        }