public ErrorMarker (TextDocument doc, Error info, DocumentLine line)
{
Info = info;
LineSegment = line;
// may be null if no line is assigned to the error.
Wave = true;
StartCol = Info.Region.BeginColumn;
if (line != null) {
var startOffset = line.Offset;
if (startOffset + StartCol - 1 >= 0) {
while (StartCol < line.Length) {
char ch = doc.GetCharAt (startOffset + StartCol - 1);
if (!char.IsWhiteSpace (ch))
break;
StartCol++;
}
}
}
if (Info.Region.EndColumn > StartCol) {
EndCol = Info.Region.EndColumn;
} else {
if (line == null) {
EndCol = StartCol + 1;
return;
}
var start = line.Offset + StartCol - 1;
int o = start + 1;
while (o < line.EndOffset) {
char ch = doc.GetCharAt (o);
if (!(char.IsLetterOrDigit (ch) || ch == '_'))
break;
o++;
}
EndCol = Info.Region.BeginColumn + o - start + 1;
}
}