@Override
  public Segment @NotNull [] getHostRanges() {
    synchronized (myLock) {
      List<Segment> markers = new ArrayList<>(myShreds.size());
      for (PsiLanguageInjectionHost.Shred shred : myShreds) {
        Segment hostMarker = shred.getHostRangeMarker();
        if (hostMarker != null) {
          markers.add(hostMarker);
        }
      }
      return markers.isEmpty() ? Segment.EMPTY_ARRAY : markers.toArray(Segment.EMPTY_ARRAY);
    }
  }
@Override
  public Segment @NotNull [] getHostRanges()