From 3bf522952c1d1db4c7ad5e078f62f89d64f31808 Mon Sep 17 00:00:00 2001 From: Anthony Vanelverdinghe Date: Mon, 16 Nov 2020 17:35:00 +0100 Subject: [PATCH] Avoid trailing space in processing instructions Signed-off-by: Anthony Vanelverdinghe --- .../src/main/java/org/eclipse/lemminx/utils/XMLBuilder.java | 1 - .../java/org/eclipse/lemminx/services/XMLFormatterTest.java | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/utils/XMLBuilder.java b/org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/utils/XMLBuilder.java index b74f93e52..1f8ef1d1d 100644 --- a/org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/utils/XMLBuilder.java +++ b/org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/utils/XMLBuilder.java @@ -340,7 +340,6 @@ public XMLBuilder startPrologOrPI(String tagName) { public XMLBuilder addContentPI(String content) { appendSpace(); append(content); - appendSpace(); return this; } diff --git a/org.eclipse.lemminx/src/test/java/org/eclipse/lemminx/services/XMLFormatterTest.java b/org.eclipse.lemminx/src/test/java/org/eclipse/lemminx/services/XMLFormatterTest.java index 023f5131d..941782d59 100644 --- a/org.eclipse.lemminx/src/test/java/org/eclipse/lemminx/services/XMLFormatterTest.java +++ b/org.eclipse.lemminx/src/test/java/org/eclipse/lemminx/services/XMLFormatterTest.java @@ -366,7 +366,7 @@ public void testProlog4WithUnknownVariable() throws BadLocationException { public void testPI() throws BadLocationException { String content = ""; String expected = "" + lineSeparator() + // - " " + lineSeparator() + // + " " + lineSeparator() + // ""; assertFormat(content, expected); } @@ -404,7 +404,7 @@ public void testDefinedPIWithJustAttributeNames() throws BadLocationException { public void testPIWithVariables() throws BadLocationException { String content = ""; String expected = "" + lineSeparator() + // - " " + lineSeparator() + // + " " + lineSeparator() + // ""; assertFormat(content, expected); }