Skip to content

Use a naming convention to ignore the unused variable warning #2388

Open
@gonghenghai

Description

@gonghenghai

For example :

        for (String i : arrayName)
            ArrayListName.add(someIntVariable++);

I need the length of arrayName, but I need not i. Obviously, the language server will prompt the warning of The value of the local variable i is not used.

I can suppress the warning through add @SuppressWarnings("unused") before the method/class. But IntelliJ has a better solution: you can rename i to ignored to suppress this warning. Could we provide a similar function?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions