}
private void formatWithEclipse(PsiFile psiFile, int startOffset, int endOffset) throws FileDoesNotExistsException {
if (FileUtils.isJavaScript(psiFile)) {
if (eclipseCodeFormatterJs == null) {
eclipseCodeFormatterJs = new EclipseCodeFormatter(settings, new JSCodeFormatterFacade(
settings.getJSProperties()));
}
eclipseCodeFormatterJs.format(psiFile, startOffset, endOffset);
} else {
eclipseCodeFormatterJava.format(psiFile, startOffset, endOffset);