// JSNI Java references mess up the JS formatter, so replace them
// with place holder values
JsniJavaRefReplacementResult replacementResults = replaceJsniJavaRefs(body);
body = replacementResults.getJsni();
CodeFormatter codeFormatter = ToolFactory.createCodeFormatter(javaScriptFormattingPrefs);
TextEdit formatEdit = codeFormatter.format(CodeFormatter.K_STATEMENTS, body, 0, body.length(),
methodIndentLevel + 1, lineDelimiter);
if (formatEdit != null) {
body = restoreJsniJavaRefs(replacementResults);