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); } }
private IEnumerable <PartitionToken> PartitionTokensFor(ITextSnapshotLine line, PartitionTokenType previousPartitionTokenType) { return(_partitioner.Tokenize(previousPartitionTokenType, line.Text)); }
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)); } } }
IEnumerable <PartitionToken> IPartitionTokenizer.Tokenize(PartitionTokenType previousPartitionTokenType, string text) { return(_partitioner.Tokenize(previousPartitionTokenType, text)); }
IEnumerable<PartitionToken> IPartitionTokenizer.Tokenize(PartitionTokenType previousPartitionTokenType, string text) { return _partitioner.Tokenize(previousPartitionTokenType, text); }
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; }
bool IsLineComment(PartitionTokenType tokenType) { return(tokenType == PartitionTokenType.CommentLineContents || tokenType == PartitionTokenType.CommentLineBegin); }