Output unnamed variables
Before this PR
Exception is thrown when there are unnamed variables in source code (issue: https://github.com/palantir/palantir-java-format/issues/1236).
The error is like, "com.palantir.javaformat.java.FormatterException: 217:106: error: expected token: '_'; generated instead".
The cases we have seen include:
- unnamed var in try-with blocks,
try (var _ = abc) {} - unnamed argument in lambda
(a, _) -> {}
After this PR
The source code can be formatted properly when containing unnamed variables.
Possible downsides?
Thanks for your interest in palantir/palantir-java-format, @chongkai! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request.
Generate changelog in changelog/@unreleased
changelog/@unreleasedType (Select exactly one)
- [ ] Feature (Adding new functionality)
- [ ] Improvement (Improving existing functionality)
- [ ] Fix (Fixing an issue with existing functionality)
- [ ] Break (Creating a new major version by breaking public APIs)
- [ ] Deprecation (Removing functionality in a non-breaking way)
- [ ] Migration (Automatically moving data/functionality to a new system)
Description
Check the box to generate changelog(s)
- [ ] Generate changelog entry
Hello, just wanted to check in β Iβd really appreciate if we could move forward with this fix as itβs something I also need π Thanks a ton in advance! πͺβ¨
I see tests are missing, that could prolong the code-review process π€
looks like I have missed the opportunity to add the change log entry when asked by the bot. How can I add one manually now?
PS, has anyone reviewed this PR?