Closed Wilson008 closed 2 years ago
The solution is: Override the method comlete{TypeName}_shortName of AbstractEatxtProposalProvider in EatxtProposalProvider.
for example: ` @Override public void completeEAPackage_ShortName(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { super.completeEAPackage_ShortName(model, assignment, context, acceptor);
long suffix = Math.round(Math.random() * 1000);
String strSuffix = Long.toString(suffix);
String proposal = "EAPackage_" + strSuffix;
acceptor.accept(createCompletionProposal(proposal, context));
}`
Note: the autogenerated name will have a random suffix.
•When shortName is needed, autocompletion could suggest a unique name in the namespace such as Actuator_0 or DesignFunctionType_0.