Files
openide/java/java-tests/testData/comment/to_javadoc/afterMergeJavadocWIthEndOfLineAndBlock.java
Nikita Eshkeev c96adaf12a [javadoc] IDEA-224332 Replace line comment before a method with a Javadoc comment
ReplaceWithJavadocIntention didn't use to take into account that comments might be defined not only above the method but before/after type/name/argument list as well. The intention used to register the intention action to make such comments a javadoc, which wasn't correct. This patch fixes the predicate in such a way that such comments don't get to be considered as candidates for conversion to javadoc.

This patch also fixes the notes from the review, it includes:

- Removing ProgressManager.checkCanceled.
- fixing the logic to build the list of comments' content: the passed PsiElement obtains its parent, which is a PsiMethod, takes the first child of the PsiMethod and gather all the first child's siblings which are of the PsiComment type up until the PsiModifier list node.

Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com>

GitOrigin-RevId: 888a838c9e5e053aa7eeb36f742b862fcae353da
2021-04-02 17:02:28 +00:00

12 lines
170 B
Java

// "Replace with javadoc" "true"
class Main {
/**
* javadoc
* hello, world
* Goodbye
* he*&#47;llo
* world
*/
private static final int i = 0;
}