redhat-developer / redhat-developer/vscode-java
Use a naming convention to ignore the unused variable warning
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 546
- Avg merge
- 20h 1m
- Merged PRs (30d)
- 11
Description
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?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start from the Java language-server handling of the unused local-variable warning described in the issue, and review how IntelliJ treats the name ignored. Determine the supported naming convention and its scope, then verify that renaming i to ignored suppresses the warning without suppressing other unused-variable diagnostics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, typescript, vscode
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100