@Override
  public int getTextLength() {
    int length = 0;
    synchronized (myLock) {
      for (PsiLanguageInjectionHost.Shred shred : myShreds) {
        Segment hostRange = shred.getHostRangeMarker();
        if (hostRange == null) continue;
        length += shred.getPrefix().length();
        length += hostRange.getEndOffset() - hostRange.getStartOffset();
        length += shred.getSuffix().length();
      }
    }
    return length;
  }
@Override
  public int getTextLength()