Exemple #1
0
 public QmlSyntaxTag(
     ITextSnapshot snapshot,
     SyntaxElement element,
     string classificationType,
     SourceLocation location)
     : this(snapshot, location)
 {
     SyntaxElement      = element;
     ClassificationType = QmlClassificationType.Get(classificationType);
 }
        protected override ClassificationTag GetClassification(TrackingTag tag)
        {
            var debugTag = tag as ExprTrackingTag;

            if (debugTag == null)
            {
                return(null);
            }
            return(new ExprTag(debugTag.Exprs, QmlClassificationType.Get(ClassificationType)));
        }
        public ITagger <T> CreateTagger <T>(ITextView textView, ITextBuffer buffer) where T : ITag
        {
            QmlClassificationType.InitClassificationTypes(classificationTypeRegistry);
            if (!QmlClassificationType.ClassificationTypes.ContainsKey(ClassificationType))
            {
                QmlClassificationType.ClassificationTypes.Add(ClassificationType,
                                                              classificationTypeRegistry.GetClassificationType(ClassificationType));
            }

            return(QmlExpressionEval.Create(textView, buffer) as ITagger <T>);
        }
        internal QmlSyntaxClassifier(ITextBuffer buffer,
                                     IClassificationTypeRegistryService typeService)
        {
            this.buffer = buffer;
            QmlClassificationType.InitClassificationTypes(typeService);
            ParseQML(buffer.CurrentSnapshot);
            buffer.Changed += Buffer_Changed;

            dispatcher = Dispatcher.CurrentDispatcher;
            timer      = new DispatcherTimer(DispatcherPriority.ApplicationIdle, dispatcher)
            {
                Interval = TimeSpan.FromMilliseconds(500)
            };
            timer.Tick += Timer_Tick;
        }
 public ITagger <T> CreateTagger <T>(ITextView textView, ITextBuffer buffer) where T : ITag
 {
     QmlClassificationType.InitClassificationTypes(classificationTypeRegistry);
     return(new QmlSyntaxClassifier(textView, buffer) as ITagger <T>);
 }