void (String textBefore, String textAfter) { var file = createFile("test." + myFileExt, textBefore); var fileAfter = createFile("test." + myFileExt, textAfter); var rangeStart = StringUtil.commonPrefixLength(textBefore, textAfter); var rangeEnd = textBefore.length() - StringUtil.commonSuffixLength(textBefore, textAfter); var range = new TextRange(Math.min(rangeStart, rangeEnd), Math.max(rangeStart, rangeEnd)); var psiToStringDefault = DebugUtil.psiToString(fileAfter, true, false, true, null); DebugUtil.performPsiModification("ensureCorrectReparse", () -> { new BlockSupportImpl().reparseRange( file, file.getNode(), range, fileAfter.getText(), new EmptyProgressIndicator(), file.getText() ).performActualPsiChange(file); }); assertEquals(psiToStringDefault, DebugUtil.psiToString(file, true, false, true, null)); }