Skip to content

LabeledExpression to highlight only label #5316

@TWiStErRob

Description

@TWiStErRob

Currently the whole expression is highlighted, creating a lot of noise in the code:
image

Expected Behavior of the rule

I think it would be more than enough to highlight the label:
image

Similar accepted requests: #4749, #5310

Context

Warnings exists in some codebases, and that's ok, but then they make the code harder to read, then it becomes a problem. A warnings should highlight where the problem is, specifically. To draw a parallel: the duplicate code inspection in IDEA looks like this:
image
Luckily this screenshot also shows that the huge warning hides another warning, see the highlighted "Check" string. I wouldn't have noticed that in the current behavior, only after editing the code / fixing the issue and you never know which severity these hidden other warnings would be, it could've been a NPE, not a duplicate string.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions