use of com.goide.psi.GoLabelDefinition in project go-lang-idea-plugin by go-lang-plugin-org.
the class GoUnusedLabelInspection method buildGoVisitor.
@NotNull
@Override
protected GoVisitor buildGoVisitor(@NotNull ProblemsHolder holder, @NotNull LocalInspectionToolSession session) {
return new GoVisitor() {
@Override
public void visitLabelDefinition(@NotNull GoLabelDefinition o) {
super.visitLabelDefinition(o);
if (o.isBlank())
return;
if (ReferencesSearch.search(o, o.getUseScope()).findFirst() == null) {
String name = o.getName();
holder.registerProblem(o, "Unused label <code>#ref</code> #loc", ProblemHighlightType.GENERIC_ERROR_OR_WARNING, new GoRenameToBlankQuickFix(o), new GoDeleteLabelStatementQuickFix(name));
}
}
};
}
Aggregations