use of com.goide.quickfix.GoDeleteConstDefinitionQuickFix in project go-lang-idea-plugin by go-lang-plugin-org.
the class GoUnusedConstInspection method buildGoVisitor.
@NotNull
@Override
protected GoVisitor buildGoVisitor(@NotNull ProblemsHolder holder, @NotNull LocalInspectionToolSession session) {
return new GoVisitor() {
@Override
public void visitConstDefinition(@NotNull GoConstDefinition o) {
if (o.isBlank())
return;
if (ReferencesSearch.search(o, o.getUseScope()).findFirst() == null) {
String constName = o.getName();
holder.registerProblem(o, "Unused constant <code>#ref</code> #loc", ProblemHighlightType.LIKE_UNUSED_SYMBOL, new GoDeleteConstDefinitionQuickFix(constName));
}
}
};
}
Aggregations