mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
[java-inspections] Class can be record: fix Javadoc refs as well (IDEA-356432)
GitOrigin-RevId: 3dc09d1554037b46773b05b973b4a5905e5b3fe5
This commit is contained in:
committed by
intellij-monorepo-bot
parent
3817a2f829
commit
bad69926e7
@@ -14,6 +14,7 @@ import com.intellij.psi.codeStyle.CodeStyleManager;
|
||||
import com.intellij.psi.impl.light.LightModifierList;
|
||||
import com.intellij.psi.javadoc.PsiDocComment;
|
||||
import com.intellij.psi.javadoc.PsiDocTag;
|
||||
import com.intellij.psi.javadoc.PsiDocTagValue;
|
||||
import com.intellij.psi.search.searches.ReferencesSearch;
|
||||
import com.intellij.psi.tree.IElementType;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
@@ -305,6 +306,10 @@ class ConvertToRecordProcessor extends BaseRefactoringProcessor {
|
||||
if (target instanceof PsiReferenceExpression refExpr && !PsiUtil.isAccessedForWriting(refExpr) && !isAccessible(target, field)) {
|
||||
refExpr.replace(JavaPsiFacade.getElementFactory(myProject).createExpressionFromText(refExpr.getText() + "()", refExpr));
|
||||
}
|
||||
if (target instanceof PsiDocTagValue docTagValue) {
|
||||
PsiDocTag docTag = JavaPsiFacade.getElementFactory(myProject).createDocTagFromText("@see " + docTagValue.getText() + "()");
|
||||
docTagValue.replace(Objects.requireNonNull(docTag.getValueElement()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,9 @@ public record SpreadSymbol(String symbol, int legs) {
|
||||
|
||||
class Use {
|
||||
/**
|
||||
* @see SpreadSymbol#legs
|
||||
* You may also want to use {@link SpreadSymbol#legs()}.
|
||||
*
|
||||
* @see SpreadSymbol#legs()
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
SpreadSymbol ss = new SpreadSymbol("123", 123);
|
||||
|
||||
@@ -16,6 +16,8 @@ public class SpreadSymb<caret>ol {
|
||||
|
||||
class Use {
|
||||
/**
|
||||
* You may also want to use {@link SpreadSymbol#legs}.
|
||||
*
|
||||
* @see SpreadSymbol#legs
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
|
||||
Reference in New Issue
Block a user