예제 #1
0
 public static TextSpan GetSourceTextSpanForLineColumn(List <TextSpanMapping> mapping, int destLine, int destColumn)
 {
     foreach (var m in mapping)
     {
         LineColumnTextSpan destLineColumnTextSpan = m.DestTextSpan.GetLineColumn();
         if (destLine >= destLineColumnTextSpan.BeginLine &&
             destLine <= destLineColumnTextSpan.EndLine)
         {
             return(m.SourceTextSpan);
         }
     }
     return(TextSpan.Empty);
 }
예제 #2
0
        public static TextSpan GetSourceTextSpanForLine(List <TextSpanMapping> textSpanMappings, int destinationLine, string sourceFileName)
        {
            foreach (TextSpanMapping textSpanMapping in textSpanMappings)
            {
                LineColumnTextSpan destLineColumnTextSpan = textSpanMapping.DestTextSpan.GetLineColumn();
                if (destinationLine >= destLineColumnTextSpan.BeginLine &&
                    destinationLine <= destLineColumnTextSpan.EndLine)
                {
                    return(textSpanMapping.SourceTextSpan);
                }
            }

            if (textSpanMappings.Count > 0)
            {
                return(new TextSpan(0, 0, textSpanMappings[0].SourceTextSpan.Source));
            }

            return(TextSpan.Empty);
        }