redhat-developer / redhat-developer/vscode-java

Organize Imports should automatically add required modules in module-info

Open
#1,388 0 comments 0 reactions 1 assignee View on GitHub

@snjeza is already working on this.

Since Apr 13, 2020.

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

Description

When I do Organize Imports, I'd like for the module-info.java file to be updated automatically as well.

Environment
  • Operating System: Windows 10
  • JDK version: 14
  • Visual Studio Code version: 1.44.0
  • Java extension version: 0.59.1
Steps To Reproduce
  1. create a file App.java as below inside a modular project
  2. do Organize Imports
class App {
    void run() {
        HttpClient client;
    }
}
Current Result

After importing java.net.http.HttpClient, the module-info.java file is unchanged.

Expected Result

The module-info.java file is automatically updated with:

requires java.net.http;

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.