// Most of ScriptCompletionProposalCollector functionality is overridden here
@Override
protected IScriptCompletionProposal createScriptCompletionProposal(CompletionProposal proposal) {
if(proposal instanceof RefSearchCompletionProposal) {
RefSearchCompletionProposal refSearchProposal = (RefSearchCompletionProposal) proposal;
INamedElement namedElement = refSearchProposal.getExtraInfo();
String completion = proposal.getCompletion();
int repStart = proposal.getReplaceStart();
int repLength = proposal.getReplaceEnd() - proposal.getReplaceStart();
Image image = createImage(proposal);
String displayString = refSearchProposal.isModuleImportCompletion() ?
namedElement.getModuleFullyQualifiedName() :
DeeElementLabelProvider.getLabelForContentAssistPopup(namedElement);
DeeCompletionProposal completionProposal = new DeeCompletionProposal(completion, repStart, repLength,
image, displayString, namedElement, null);