Skip to content

Commit f434db1

Browse files
committed
Add inspection for "ZIO.fail(throw"
1 parent bdcdaa8 commit f434db1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main/scala/zio/intellij/inspections/mistakes/ZIOFailThrowInspection.scala

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ import zio.intellij.inspections.`ZIO.fail`
99
class ZIOFailThrowInspection extends LocalInspectionTool {
1010

1111
override def buildVisitor(holder: ProblemsHolder, isOnTheFly: Boolean): PsiElementVisitorSimple = {
12-
case f @ `ZIO.fail`(_, b: ScThrow) =>
13-
b.expression match {
14-
case Some(expr) =>
12+
case fail @ `ZIO.fail`(_, scThrow: ScThrow) =>
13+
scThrow.expression match {
14+
case Some(throwableExpr) =>
1515
holder.registerProblem(
16-
f,
16+
fail,
1717
ZIOFailThrowInspection.message,
1818
ProblemHighlightType.WARNING,
19-
new QuickFix(b, expr)
19+
new QuickFix(scThrow, throwableExpr)
2020
)
2121
case None =>
2222
}

0 commit comments

Comments
 (0)