Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Java9/Use cases"

(Search)
(Creation of module-info)
Line 2: Line 2:
  
 
== Creation of module-info ==
 
== Creation of module-info ==
 +
*[status : Basic implementation done]
 
*User manually creates a module-info, similar to package-info.
 
*User manually creates a module-info, similar to package-info.
 
**The created module info has just the module name and an empty body.
 
**The created module info has just the module name and an empty body.

Revision as of 06:44, 28 March 2017

We will write down user scenarios and use cases related to Java modules here that will eventually become part of existing features or new features.

Creation of module-info

  • [status : Basic implementation done]
  • User manually creates a module-info, similar to package-info.
    • The created module info has just the module name and an empty body.
  • A new wizard/dialogue to create a blank module-info or to create one from the existing project
    • Wizard pulls out all the packages in the project (sources only) across all source folders

and also picks up the modules used by project and populates the module-info

    • If the project has a MANIFEST.MF, it should use that information (x-internal, x-friends, reexport, etc.)
  • Make sure that the Java build is updated, i.e. org.eclipse.jdt.MODULE_PATH is added automatically

Manipulation of module-info

  • change module-info in all possible ways, e.g. add/remove modules and packages
  • verify that reconciler (problems while typing), the markers after save, and the Module Source Path container is updated
  • have a way to see the module target platform

Search

  • The search scope should be decided appropriately.
  • May think of putting a configurable button "find in module-info.java" as applicable for the constructs - use case of this to be discussed.
  • Selection based search from module-info.java file
  • The work is in progress - currently, packages and types are found in the module-info.java file

DOM AST

  • bug 496123 New elements created for module-info.java constructs in DOM/AST one each for the exports, opens, requires, provides and uses.
  • bug bug 506430 for formatting is a consumer of AST

Completion

  • Keyword completions such as exports, opens, requires, provides, uses and to in exports.
  • completion on package references in exports, opens, provides and uses.
  • Type reference completions uses, provides-interface and provides-implementations (implementation sensitive to interfaces as well)
  • Module reference completions in targeted exports and requires
  • Tracked via bug 486988

Quick assist

  • Fill in

Quick fix

  • Unresolved package in 'exports'
    • Offer to create the package?
  • Unresolved type in 'with' clause
    • Offer to create an empty type that implements the mentioned service.
  • Unresolved type in 'provides' clause
    • ?
  • 'with' does not implement 'provides'
    • Offer to make the implementation implement the interface
  • Unresolved import or type in a class
    • Offer to add the module to 'requires' clause

Hover

  • Hover on module names (the whole name, not just fragments) should display the module name
    • Dani: I question how useful this is if we don't show any additional information than what's already in the editor.
      • Jay:That's not what I really meant. I just meant that's what happens as default behavior without any Javdoc on that element.
      • Dani:Yes, but see next item. Currently it's only the name I think. That was my point. As soon as we have Javadoc, it makes perfect sense.
    • When and if the spec allows Javadoc, then the documentation should be displayed in the hover
    • PROBLEM: Modules shipped with Java 9 currently don't come with module-info.java in the src.zip
  • Hover on all package and type names should work like everywhere else.

Code navigation

  • Action on module should open the module-info.java or module-info.class
  • Action on package names should open the package-info if present.
  • Action on any types, should open the type, even those in other modules than the current one.

Using legacy JAR files in a module project

  • Legacy JAR files or class folders continue to be supported by Java module projects. To be able to use them, the user

adds the path to the build path, as he normally would. In addition to that, he can choose to tell the compiler whether or not promote a JAR as automatic modules. The compiler seems an automatic module differently from an unnamed module. The IDE should allow the user to do this (bug 506878 & bug 508708)

  • Similar support would be provided in command line compiler as well, but the distinction between automatic and unnamed modules is made based on where the JAR path is found, in the -modulepath or -classpath.

Outline View

  • Add more here

Back to the top