Repository navigation
Keep javadoc inline tags like {@link ...} together - #125
Conversation
Generate changelog in
|
| } else if (input.tryConsume("}")) { | ||
| braceDepth.decrementIfPositive(); | ||
| return LITERAL; | ||
| return braceDepth.isPositive() ? LITERAL : INLINE_TAG_CLOSE; |
There was a problem hiding this comment.
What happens here with nested inline tags? I noticed there's an inlineTagDepth in the other file, but I would have thought that this would only make these tokens for the outermost (from my brief can of these changes)?
There was a problem hiding this comment.
Do we even care about nested inline tags?
There was a problem hiding this comment.
we care for situations like
{@code
class Foo {
}
}<pre>
as shown in one of the tests I added, that's actually copied from one of the integration tests where this was initially being handled incorrectly.
Specifically, we want to treat the closing brace of the class as a literal (i.e. this is still literal stuff inside the code block), and only the last brace as a INLINE_TAG_CLOSE.
There was a problem hiding this comment.
On the other hand, in the other method, I use another one of these depth counters but I don't think the number can be anything other than 0 or 1.
|
👍 |
|
Released 0.3.12 |
Before this PR
JavadocFormatter splits inline tags with spaces, for example
{@link com.palantir.SomeClass}, such that they can end up likeAfter this PR
==COMMIT_MSG==
In javadocs, keep inline tags like
{@link ...}on one line if not already split.==COMMIT_MSG==
Possible downsides?