private static void AddFold(TextDocument document, ICollection<NewFolding> foldMarkers, int startOffset, int endOffset, string label)
{
// Do not add folding if start and end are on the same line.
int startLine = document.GetLocation(startOffset).Line;
int endLine = document.GetLocation(endOffset).Line;
if (startLine >= endLine)
return;
foldMarkers.Add(new NewFolding(startOffset, endOffset) { Name = label });
}