void (LeafElement leaf) { String leafText = leaf instanceof ForeignLeafPsiElement ? "" : leaf.getText(); catLeafs.append(leafText); TextRange leafRange = leaf.getTextRange(); StringBuilder leafEncodedText = constructTextFromHostPSI(leafRange.getStartOffset(), leafRange.getEndOffset()); if (!Comparing.equal(leafText, leafEncodedText)) { newTexts.put(leaf, leafEncodedText.toString()); storeUnescapedTextFor(leaf, leafText); } }