What is necessary to get classes provided via custom classpath container visible in the code completion?
I have successfully implemented a custom classpath container, that adds libraries to a project. It adds all jars in a specific folder to the build path unless there is a project with the same name in the workspace, in that case the project is referenced.
Now this obviously seems to work, when I refer to a class from one of those jars, the code compiles, but I do not see the class in the code completion suggestions. When I have the correct project in my workspace, then I see such a class in the code completion.
I have done the following steps to reach this, while I was partly considering a tutorial from IBM:
- Implement ClasspathContainerInitializer
- Implement ClasspathContainerPreferencePage for additional configuration
- Implement IClasspathContainer
When I have added the container to a project I see the jars in the packages explorer as I expected it. (Jar there only if no corresponding project is available, Logging shows expected results)
I can use classes from jars integrated via classpath container without compiler errors, they are just not available for code completion and in Quick Fixes to add the right import. So I guess I maybe just miss contributing to some extension point.
javaCompletionProposalComputer
might be a good start. The coderecommenders project has an example of usage: git.eclipse.org/c/recommenders/org.eclipse.recommenders.git/… – Ferrer