Community
Participate
Working Groups
Having a grammar with references to Jvm-Types, I experience the following. In the runtime workspace I have two unrelated Java projects X and Y. X contains a model with said references, Y contains a class Z implementing the java.util.Iterator interface. Without adaptions to the proposal provider, invoking code completion Z is not proposed, just as expected. Now I adapt the proposals fo the references: @Inject ITypesProposalProvider provider; @Inject ITypeProvider.Factory factory; @Override public void completeJavaReference_Typeref(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { ResourceSet set = model.eResource().getResourceSet(); ITypeProvider tp = factory.findTypeProvider(set); if (tp == null) { tp = factory.createTypeProvider(set); } if (tp == null) { return; } try { JvmType t = tp.findTypeByName("java.util.Iterator"); provider.createSubTypeProposals(t, this, context, acceptor); } catch (TypeNotFoundException e) { } } that is I want only references to classes implementing the said interface. Now, invoking code completion the list of proposals is much shorter as expected, however Z is among the proposals (as is java.lang.Object). (Choosing Z, the reference cannot be resolved as expected.) Further, the updated documentation suggests the use of an IScopableTypesProposalProvider providing a code example. Using that code, I do get a scope without Z in it. However the resulting proposal list does again include Z. Maybe I am using the wrong scopableProposalProvider (the snippet does not say where it is coming from, so I simply used the injeced JdtTypesProposalProvider).
Pushed fix to master.
Closing all bugs that were set to RESOLVED before Neon.0