public override void AddLexicalClassifications(SourceText text, TextSpan textSpan, List <ClassifiedSpan> result, CancellationToken cancellationToken)
        {
            var temp = ArrayBuilder <ClassifiedSpan> .GetInstance();

            ClassificationHelpers.AddLexicalClassifications(text, textSpan, temp, cancellationToken);
            AddRange(temp, result);
            temp.Free();
        }
示例#2
0
        private void ClassifyToken(SyntaxToken token)
        {
            var span = token.Span;

            if (ShouldAddSpan(span))
            {
                var type = ClassificationHelpers.GetClassification(token);

                if (type != null)
                {
                    AddClassification(span, type);

                    // Additionally classify static symbols
                    if (token.Kind() == SyntaxKind.IdentifierToken &&
                        ClassificationHelpers.IsStaticallyDeclared(token))
                    {
                        AddClassification(span, ClassificationTypeNames.StaticSymbol);
                    }
                }
            }

            ClassifyTriviaList(token.LeadingTrivia);
            ClassifyTriviaList(token.TrailingTrivia);
        }
 public override ClassifiedSpan AdjustStaleClassification(SourceText text, ClassifiedSpan classifiedSpan)
 => ClassificationHelpers.AdjustStaleClassification(text, classifiedSpan);
示例#4
0
 public override void AddLexicalClassifications(SourceText text, TextSpan textSpan, ArrayBuilder <ClassifiedSpan> result, CancellationToken cancellationToken)
 => ClassificationHelpers.AddLexicalClassifications(text, textSpan, result, cancellationToken);