-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This tightens the AST compact printing #2872
Conversation
See #2869 - with tests fixed
@SuppressWarnings("SameParameterValue") | ||
private <T extends Node> String jointight(List<T> nodes, String delim, String prefix, String suffix) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hyper nit: could you make it camelCase joinTight
For people with poor eyesight like me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
if (first) { | ||
first = false; | ||
} else { | ||
boolean canButtTogether = lastNodeText.endsWith("}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean canPutTogether
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok you win this time
output == '''{aliasOfFoo:foo(arg1:"val1",args2:"val2") @isCached {hello} world @neverCache @okThenCache} fragment FX on SomeType {aliased:field(withArgs:"argVal",andMoreArgs:"andMoreVals")}''' | ||
isParseableAst(output) | ||
output == '''{aliasOfFoo:foo(arg1:"val1",args2:"val2") @isCached{hello}world @neverCache @okThenCache} fragment FX on SomeType {aliased:field(withArgs:"argVal",andMoreArgs:"andMoreVals")}''' | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also tighten directives
{foo(arg1:"val1",args2:"val2") @isCached{hello}world @neverCache @okThenCache}}
{foo(arg1:"val1",args2:"val2")@isCached{hello}world@neverCache@okThenCache}}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
See #2869
Tests need to be fixed