redhat-developer / redhat-developer/vscode-java

Import that is used in @code or @link in JavaDoc is marked as unused

Open
#2,035 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

diagnostics
Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

Imports that are only used in @code or @link of JavaDoc are marked as unused and Organize imports will remove them.

Environment
  • Operating System: 20.04.2 LTS (Focal Fossa)
  • JDK version: openjdk 11.0.6 2020-01-14
  • Visual Studio Code version: 1.58.2
  • Java extension version: v.0.81.0
Steps To Reproduce
  1. Check out https://github.com/fvclaus/vscode-java-javadoc-link-bug and open App.java
  2. Run Organize imports
import java.util.HashSet;

/**
 * Uses {@code HashSet#clear()}
 *
 */

vscode_javadoc

Current Result

Import is marked as unused and will be removed with Organize imports.

Expected Result

Import is not marked as unused and will not be removed with Organize imports.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the App.java reproduction linked in the issue and run Organize imports to confirm how the HashSet reference in {@code} is handled. Trace the unused-import analysis and JavaDoc reference handling from that behavior. Done means imports used only in JavaDoc are not marked unused or removed by Organize imports.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, vscode
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.