public OutliningTagger(ITextBuffer textBuffer, TextBufferParser parser)
 {
     _textBuffer = textBuffer;
     _parser     = parser;
     _parser.ParseTreeChanged += (s, e) => { Reparse(); OnTagsChanged(e); };
     Reparse();
 }
Beispiel #2
0
        internal Classifier(IClassificationTypeRegistryService registry, TextBufferParser parser)
        {
            _comment   = registry.GetClassificationType(PredefinedClassificationTypeNames.Comment);
            _anchor    = registry.GetClassificationType("YamlAnchor");
            _alias     = registry.GetClassificationType("YamlAlias");
            _key       = registry.GetClassificationType(PredefinedClassificationTypeNames.SymbolDefinition);
            _value     = registry.GetClassificationType(PredefinedClassificationTypeNames.String);
            _tag       = registry.GetClassificationType("YamlTag");
            _symbol    = registry.GetClassificationType("YamlSymbol");
            _directive = registry.GetClassificationType("YamlDirective");

            _parser = parser;
            _parser.ParseTreeChanged += (s, e) => OnClassificationChanged(new ClassificationChangedEventArgs(e.Span));
        }