private IEnumerable<ClassificationSpan> ClassificationsFor(ITextSnapshotLine line, PartitionTokenType previousPartitionTokenType)
		{
			foreach (var partitionToken in PartitionTokensFor(line, previousPartitionTokenType))
			{
				var textSpan = TextSpanForPartitionOfLine(line, partitionToken);

				if (partitionToken.Type == PartitionTokenType.Code)
					foreach (var classificationSpan in ClassificationsFor(textSpan))
						yield return classificationSpan;
				else
					yield return new ClassificationSpan(ClassificationFor(partitionToken), textSpan);
			}
		}
Пример #2
0
 private IEnumerable <PartitionToken> PartitionTokensFor(ITextSnapshotLine line, PartitionTokenType previousPartitionTokenType)
 {
     return(_partitioner.Tokenize(previousPartitionTokenType, line.Text));
 }
Пример #3
0
        private IEnumerable <ClassificationSpan> ClassificationsFor(ITextSnapshotLine line, PartitionTokenType previousPartitionTokenType)
        {
            foreach (var partitionToken in PartitionTokensFor(line, previousPartitionTokenType))
            {
                var textSpan = TextSpanForPartitionOfLine(line, partitionToken);

                if (partitionToken.Type == PartitionTokenType.Code)
                {
                    foreach (var classificationSpan in ClassificationsFor(textSpan))
                    {
                        yield return(classificationSpan);
                    }
                }
                else
                {
                    yield return(new ClassificationSpan(ClassificationFor(partitionToken), textSpan));
                }
            }
        }
Пример #4
0
 IEnumerable <PartitionToken> IPartitionTokenizer.Tokenize(PartitionTokenType previousPartitionTokenType, string text)
 {
     return(_partitioner.Tokenize(previousPartitionTokenType, text));
 }
Пример #5
0
 IEnumerable<PartitionToken> IPartitionTokenizer.Tokenize(PartitionTokenType previousPartitionTokenType, string text)
 {
     return _partitioner.Tokenize(previousPartitionTokenType, text);
 }
Пример #6
0
 private IEnumerable<PartitionToken> PartitionTokensFor(ITextSnapshotLine line, PartitionTokenType previousPartitionTokenType)
 {
     return _partitioner.Tokenize(previousPartitionTokenType, line.Text);
 }
		bool IsLineComment(PartitionTokenType tokenType)
		{
			return tokenType == PartitionTokenType.CommentLineContents || tokenType == PartitionTokenType.CommentLineBegin;
		}
Пример #8
0
 bool IsLineComment(PartitionTokenType tokenType)
 {
     return(tokenType == PartitionTokenType.CommentLineContents || tokenType == PartitionTokenType.CommentLineBegin);
 }