[124070] [editor] JSPX editor doesn't honor indent with spaces
diff --git a/tests/org.eclipse.jst.jsp.ui.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.jst.jsp.ui.tests/META-INF/MANIFEST.MF index 9713a23..c737856 100644 --- a/tests/org.eclipse.jst.jsp.ui.tests/META-INF/MANIFEST.MF +++ b/tests/org.eclipse.jst.jsp.ui.tests/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name.0 Bundle-SymbolicName: org.eclipse.jst.jsp.ui.tests; singleton:=true -Bundle-Version: 1.0.601.qualifier +Bundle-Version: 1.0.700.qualifier Bundle-ClassPath: jspuitests.jar Bundle-Activator: org.eclipse.jst.jsp.ui.tests.JSPUITestsPlugin Bundle-Vendor: %Bundle-Vendor.0
diff --git a/tests/org.eclipse.jst.jsp.ui.tests/src/org/eclipse/jst/jsp/ui/tests/format/TestContentFormatter.java b/tests/org.eclipse.jst.jsp.ui.tests/src/org/eclipse/jst/jsp/ui/tests/format/TestContentFormatter.java index b50a0a5..fe03512 100644 --- a/tests/org.eclipse.jst.jsp.ui.tests/src/org/eclipse/jst/jsp/ui/tests/format/TestContentFormatter.java +++ b/tests/org.eclipse.jst.jsp.ui.tests/src/org/eclipse/jst/jsp/ui/tests/format/TestContentFormatter.java
@@ -31,6 +31,8 @@ import org.eclipse.jface.text.formatter.IFormattingContext; import org.eclipse.jface.text.source.SourceViewerConfiguration; import org.eclipse.jst.jsp.ui.StructuredTextViewerConfigurationJSP; +import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin; +import org.eclipse.jst.jsp.ui.internal.preferences.JSPUIPreferenceNames; import org.eclipse.jst.jsp.ui.tests.util.ProjectUtil; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.ide.IDE; @@ -235,4 +237,15 @@ public void testFormatBug383387() throws UnsupportedEncodingException, IOException, CoreException { formatAndAssertSignificantEquals("/" + PROJECT_NAME + "/WebContent/formatBug383387.jsp", true); } + public void testFormatBug124070() throws UnsupportedEncodingException, IOException, CoreException { + try { + JSPUIPlugin.getInstance().getPreferenceStore().setValue(JSPUIPreferenceNames.USE_HTML_FORMATTER, false); + String beforePath = "/" + PROJECT_NAME + "/WebContent/formatbug124070.jspx"; + String afterPath = "/" + PROJECT_NAME + "/WebContent/formatbug124070-fmt.jspx"; + formatAndAssertEquals(beforePath, afterPath, true); + } + finally { + JSPUIPlugin.getInstance().getPreferenceStore().setValue(JSPUIPreferenceNames.USE_HTML_FORMATTER, true); + } + } }
diff --git a/tests/org.eclipse.jst.jsp.ui.tests/testfiles/jspformatting/WebContent/formatbug124070-fmt.jspx b/tests/org.eclipse.jst.jsp.ui.tests/testfiles/jspformatting/WebContent/formatbug124070-fmt.jspx new file mode 100644 index 0000000..c596282 --- /dev/null +++ b/tests/org.eclipse.jst.jsp.ui.tests/testfiles/jspformatting/WebContent/formatbug124070-fmt.jspx
@@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<html xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:jsp="http://java.sun.com/JSP/Page" + xmlns="http://www.w3.org/1999/xhtml"> + <jsp:output doctype-root-element="html" + doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" + doctype-system="http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" /> + <body> + <c:out value="hello" /> + <jsp:directive.include file="dukebanner.html"/> + </body> +</html> \ No newline at end of file
diff --git a/tests/org.eclipse.jst.jsp.ui.tests/testfiles/jspformatting/WebContent/formatbug124070.jspx b/tests/org.eclipse.jst.jsp.ui.tests/testfiles/jspformatting/WebContent/formatbug124070.jspx new file mode 100644 index 0000000..7ce7524 --- /dev/null +++ b/tests/org.eclipse.jst.jsp.ui.tests/testfiles/jspformatting/WebContent/formatbug124070.jspx
@@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<html xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:jsp="http://java.sun.com/JSP/Page" +xmlns="http://www.w3.org/1999/xhtml"> + <jsp:output doctype-root-element="html" + doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" + doctype-system="http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" /> +<body> + <c:out value="hello" /> +<jsp:directive.include file="dukebanner.html"/> +</body> +</html> \ No newline at end of file