TextRange (@NotNull PsiForStatement statement, @NotNull ProblemHighlightType type) { PsiStatement initialization = statement.getInitialization(); LOG.assertTrue(initialization != null); TextRange range = TextRange.from(initialization.getStartOffsetInParent(), initialization.getTextLength()); boolean wholeStatement = isOnTheFly && (InspectionProjectProfileManager.isInformationLevel(getShortName(), statement) || type == ProblemHighlightType.INFORMATION); PsiJavaToken rParenth = statement.getRParenth(); if (wholeStatement && rParenth != null) { range = new TextRange(0, rParenth.getStartOffsetInParent() + 1); } return range; }