google / google/google-java-format

Support Markdown Documentation Comments (JEP 467, JDK 23)

未關閉
#1,193 9 則留言 22 個 reaction 已指派 1 人 已被 @eamonnmcmanus 認領 在 GitHub 檢視
Java 25
主要語言
Java
星號
6.2k
分支
937
平均合併
6 分鐘
30 天內合併 PR
3

描述

Consider the following code:

```java
import java.nio.ByteBuffer;

interface BufferAllocator {
/// Returns a lease for a [ByteBuffer] with at least the specified [capacity][ByteBuffer#capacity].
LeasedByteBuffer getByteBuffer(long minCapacity);
}
```

Formatting the above code causes the following issues:
1. The doc comment is split into two lines, but the second line starts with `//` instead of `///`.
2. The import statement is removed, breaking the links.

Disabling Javadoc formatting doesn't prevent either issue.
The only workaround I could find was to disable google-java-format.

Tested with JDK 23 and google-java-format 1.24.0.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。