| Summary: | [1.9] Classes only available by adding an module-info don't show up in autocomplete | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Thomas Schindl <tom.schindl> |
| Component: | Core | Assignee: | Jay Arthanareeswaran <jarthana> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | jarthana, manoj.palat, noopur_gupta, sarika.sinha |
| Version: | 4.7 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Mac OS X | ||
| Whiteboard: | |||
Correction: Just enter "Appl" else the only proposal is "ApplicationException" and it is inserted. "javafx.application.Application" proposal is not returned by ICodeAssist.codeComplete(int offset, CompletionRequestor requestor, IProgressMonitor monitor) at JavaCompletionProposalComputer#internalComputeCompletionProposals in this case. Moving to JDT/Core. Works fine on master, Could you try with the latest Y-build just to confirm? Can be downloaded from http://download.eclipse.org/eclipse/downloads/drops4/Y20170112-1300/ The patch most likely does not include the content assist support. We need a new patch built and pushed to the market place I was able to reproduce it on master. (In reply to comment #4) > I was able to reproduce it on master. I still can't, trying really hard :-). Jay, what about you? Can you give it a quick try and see? It's with the HEAD of BETA_JAVA9 branch (not master). I can reproduce in HEAD of BETA_JAVA9. I will check with Manoj if this is still in progress. I don't see the relevant types coming from the indexer. Possibly some modules excluded by the indexer? Over to you, Manoj. Okay, investigated bit more and this is about the access restrictions of excluding everything except the select java/** and javax/**. IIRC, there was bug about this, but unable to dig it out now. (In reply to Jay Arthanareeswaran from comment #9) > Okay, investigated bit more and this is about the access restrictions of > excluding everything except the select java/** and javax/**. IIRC, there was > bug about this, but unable to dig it out now. I can also confirm that completion doesn't work with a JDK 8 either. So, this isn't about Java 9 or modules but about the access restrictions we seem to have in place for non java(x)/** packages. Sarika, can you comment on this please? Or who will know better about the rules? This is same as bug 480997. The workaround for the bug is to add the JDK as JRE itself instead of EE. *** This bug has been marked as a duplicate of bug 480997 *** You are absolutely right! I was so thinking on JDT-9 that I forgot that normally I have e(fx)clipse installed who fixes the Access-Rules to add javafx.* |
For classes not available by default eg all JavaFX stuff one needs to add a module-info.java like this: --- module TestJ9 { requires javafx.base; requires javafx.graphics; requires javafx.controls; } --- This makes code like this --- package tes; import javafx.application.*; import javafx.stage.*; import javafx.scene.*; import javafx.scene.layout.*; import javafx.scene.control.*; public class Main extends Application { public static void main(String[] args) { Application.launch(args); } @Override public void start(Stage stage) throws Exception { BorderPane p = new BorderPane(new Label("Hello Java 9")); Scene s = new Scene(p,200,200); stage.setScene(s); stage.show(); } } --- compile but it looks like the content shown in by triggering auto-complete does not involve those classes. To reproduce: * create a new line * enter Appli * hit enter Expected: Proposal list contains javafx.application.Application