diff --git a/magik-squid/src/main/java/nl/ramsolutions/sw/magik/formatting/MagikFormattingStrategy.java b/magik-squid/src/main/java/nl/ramsolutions/sw/magik/formatting/MagikFormattingStrategy.java index 44bd3bd8..fa02ffb7 100644 --- a/magik-squid/src/main/java/nl/ramsolutions/sw/magik/formatting/MagikFormattingStrategy.java +++ b/magik-squid/src/main/java/nl/ramsolutions/sw/magik/formatting/MagikFormattingStrategy.java @@ -186,7 +186,11 @@ private boolean requireWhitespaceBefore(final Token token) { && (this.tokenIs(token, "<<", "^<<"))) && !this.tokenIs(token, ".", ",", ")", "}", "]") && !this.tokenIs(this.lastToken, "(", "{", "[") - && !this.tokenIs(this.lastTextToken, "_proc", "_loopbody"); // Except for _proc/_loopbody. + && !this.tokenIs( + this.lastTextToken, + "_proc", + "_loopbody", + "_super"); // Except for _proc/_loopbody/_super. } private boolean requireNoWhitespaceBefore(final Token token) { @@ -194,7 +198,7 @@ private boolean requireNoWhitespaceBefore(final Token token) { this.lastTextToken != null ? this.lastTextToken.getOriginalValue().toLowerCase() : null; return !this.tokenIs(token, GenericTokenType.COMMENT) && (this.tokenIs(token, ")", "}", "]", ",") - || this.tokenIs(this.lastTextToken, "@", "(", "{", "[", "_proc", "_loopbody") + || this.tokenIs(this.lastTextToken, "@", "(", "{", "[", "_proc", "_loopbody", "_super") || this.nodeIsSlot() || this.currentNode.is(MagikGrammar.ARGUMENTS) || this.currentNode.is(MagikGrammar.PARAMETERS) diff --git a/magik-squid/src/test/java/nl/ramsolutions/sw/magik/formatting/FormattingWalkerTest.java b/magik-squid/src/test/java/nl/ramsolutions/sw/magik/formatting/FormattingWalkerTest.java index 32eaee05..46520bb6 100644 --- a/magik-squid/src/test/java/nl/ramsolutions/sw/magik/formatting/FormattingWalkerTest.java +++ b/magik-squid/src/test/java/nl/ramsolutions/sw/magik/formatting/FormattingWalkerTest.java @@ -267,12 +267,19 @@ void testProcDefinitionParameters(final String code) { } @Test - void testLoopbdoyDefinitionParameters() { + void testLoopbodyDefinitionParameters() { final String code = "_loopbody(x, y, z)"; final List edits = this.getEdits(code); assertThat(edits).isEmpty(); } + @Test + void testSuperDefinitionParameters() { + final String code = "_super(mysuper)"; + final List edits = this.getEdits(code); + assertThat(edits).isEmpty(); + } + // endregion // region: Indenting.