private @NotNull MappedRange insertMapping(int tokenIndex, @NotNull IElementType outerToken) {
      CharSequence tokenText = getTokenText(tokenIndex);

      int length = tokenText.length();

      MappedRange predecessor = findPredecessor(tokenIndex, getMappingSegments());

      int insertOffset = predecessor != null ? predecessor.range.getEndOffset() : 0;
      doc.insertString(insertOffset, new MergingCharSequence(mySeparator, tokenText));
      insertOffset += mySeparator.length();

      RangeMarker marker = doc.createRangeMarker(insertOffset, insertOffset + length);
      return new MappedRange(this, marker, outerToken);
    }
private @NotNull MappedRange insertMapping(int tokenIndex, @NotNull IElementType outerToken)