Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

Bugfix for #748 #771

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,19 @@ void AddCommentTags(SyntaxTree cu, IList<TagComment> tagComments, ITextSource fi
int endOffset;
int searchOffset = 0;
// HACK: workaround for parser bug: uses \n instead of \r\n in comment.Content
string commentContent = document.GetText(commentStartOffset, Math.Min(commentEndOffset - commentStartOffset + 1, commentEndOffset - commentStartOffset));
string commentContent = document.GetText(commentStartOffset, Math.Abs(Math.Min(commentEndOffset - commentStartOffset + 1, commentEndOffset - commentStartOffset)));
do {
int start = commentStartOffset + searchOffset;
int absoluteOffset = document.IndexOf(match, start, document.TextLength - start, StringComparison.Ordinal);
var startLocation = document.GetLocation(absoluteOffset);
endOffset = Math.Min(document.GetLineByNumber(startLocation.Line).EndOffset, commentEndOffset);
string content = document.GetText(absoluteOffset, endOffset - absoluteOffset);
string content = document.GetText(absoluteOffset, Math.Abs(endOffset - absoluteOffset));
if (content.Length < match.Length) {
// HACK: workaround parser bug with multi-line documentation comments
break;
}
tagComments.Add(new TagComment(content.Substring(0, match.Length), new DomRegion(cu.FileName, startLocation.Line, startLocation.Column), content.Substring(match.Length)));
searchOffset = endOffset - commentStartOffset;
searchOffset = Math.Abs(endOffset - commentStartOffset);
} while (commentContent.ContainsAny(TaskListTokens, searchOffset, out match));
}
}
Expand Down