Skip to content

Commit 989d5f2

Browse files
committed
Highlight and replace whole continue statement element
1 parent 7a76b21 commit 989d5f2

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/com/goide/inspections/GoContinueNotInLoopInspection.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,9 @@ protected GoVisitor buildGoVisitor(@NotNull final ProblemsHolder holder, @NotNul
3939
return new GoVisitor() {
4040
@Override
4141
public void visitContinueStatement(@NotNull GoContinueStatement o) {
42-
if (PsiTreeUtil.getParentOfType(o.getContinue(), GoForStatement.class) == null) {
43-
holder
44-
.registerProblem(o.getContinue(), "Continue statement not inside a for loop.", ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
45-
new ReplaceWithReturnQuickFix());
42+
if (PsiTreeUtil.getParentOfType(o, GoForStatement.class) == null) {
43+
holder.registerProblem(o, "Continue statement not inside a for loop.", ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
44+
new ReplaceWithReturnQuickFix());
4645
}
4746
}
4847
};

0 commit comments

Comments
 (0)