Skip to content

Commit 5c9cc92

Browse files
committed
Mark redundant type as unused symbol
1 parent 572f8c7 commit 5c9cc92

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/com/goide/inspections/GoRedundantTypeDeclInCompositeLit.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,10 @@ public void visitCompositeLit(@NotNull GoCompositeLit o) {
5656
if (isTypeReferencesEquals(((GoPointerType)expectedType).getType(), compositeLit)) {
5757
GoTypeReferenceExpression typeExpr = compositeLit.getTypeReferenceExpression();
5858
if (typeExpr != null) {
59-
holder.registerProblem(holder.getManager().createProblemDescriptor(bitAnd, typeExpr,
60-
"Redundant type declaration",
59+
GoDeleteAmpersandAndTypeInCompositeLitQuickFix fix = new GoDeleteAmpersandAndTypeInCompositeLitQuickFix();
60+
holder.registerProblem(holder.getManager().createProblemDescriptor(bitAnd, typeExpr, "Redundant type declaration",
6161
ProblemHighlightType.LIKE_UNUSED_SYMBOL,
62-
holder.isOnTheFly(),
63-
new GoDeleteAmpersandAndTypeInCompositeLitQuickFix()));
62+
holder.isOnTheFly(), fix));
6463
}
6564
}
6665
}
@@ -69,7 +68,7 @@ else if (expr instanceof GoCompositeLit && isTypeReferencesEquals(expectedType,
6968
GoTypeReferenceExpression typeExpr = ((GoCompositeLit)expr).getTypeReferenceExpression();
7069
if (typeExpr != null) {
7170
GoDeleteQuickFix fix = new GoDeleteQuickFix(DELETE_TYPE_DECLARATION_QUICK_FIX_NAME, GoTypeReferenceExpression.class);
72-
holder.registerProblem(typeExpr, "Redundant type declaration", fix);
71+
holder.registerProblem(typeExpr, "Redundant type declaration", ProblemHighlightType.LIKE_UNUSED_SYMBOL, fix);
7372
}
7473
}
7574
}

0 commit comments

Comments
 (0)