From fb456b20ecfbbc1d828db8dda317ec8bd4e21fab Mon Sep 17 00:00:00 2001 From: "Christian G. Warden" Date: Wed, 4 Dec 2024 13:17:36 -0600 Subject: [PATCH] Remove Spaces From Annotation Arguments --- formatter/format_test.go | 13 +++++++++++++ formatter/visitors.go | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/formatter/format_test.go b/formatter/format_test.go index 7a36ea3..20a9ca5 100644 --- a/formatter/format_test.go +++ b/formatter/format_test.go @@ -429,6 +429,19 @@ func TestCompilationUnit(t *testing.T) { `public class MyClass { public static void noop() {}}`, `public class MyClass { public static void noop() {} +}`}, + { + `public class MyClass { + @future (callout=true) + public static void noop() {} + @JsonAccess (serializable = 'samePackage' deserializable = ’sameNamespace’) + public class Serializable{} + }`, + `public class MyClass { + @future(callout=true) + public static void noop() {} + @JsonAccess(serializable='samePackage' deserializable=’sameNamespace’) + public class Serializable {} }`}, { `class TestClass { diff --git a/formatter/visitors.go b/formatter/visitors.go index 1811df6..2362bae 100644 --- a/formatter/visitors.go +++ b/formatter/visitors.go @@ -1351,7 +1351,7 @@ func (v *FormatVisitor) VisitDelimitedElementValuePair(ctx *parser.DelimitedElem } func (v *FormatVisitor) VisitElementValuePair(ctx *parser.ElementValuePairContext) interface{} { - return fmt.Sprintf("%s = %s", v.visitRule(ctx.Id()), v.visitRule(ctx.ElementValue())) + return fmt.Sprintf("%s=%s", v.visitRule(ctx.Id()), v.visitRule(ctx.ElementValue())) } func (v *FormatVisitor) VisitElementValue(ctx *parser.ElementValueContext) interface{} {