for(int i=0;i < children.length;i++){
if (children[i] instanceof VhdlSubprogram) {
VhdlSubprogram subProgram = (VhdlSubprogram) children[i];
if(subProgram.getName().toLowerCase().startsWith(replace.toLowerCase())){
VhdlSubprogramProposalProvider proposalProvider=
new VhdlSubprogramProposalProvider(doc,subProgram,offset,length);
HdlTemplateProposal proposal=proposalProvider.createProposal();
matchList.add(proposal);
}
}
}
if (parent.getParent() instanceof VhdlOutlineElement) {
parent = (VhdlOutlineElement) parent.getParent();
}
else{
parent=null;
}
}
//look into packages
OutlineDatabase database = doc.getOutlineDatabase();
if (database != null) {
OutlineElement[] elements = database.findTopLevelElements("");
for (int i = 0; i < elements.length; i++) {
if(elements[i] instanceof PackageDeclElement){
OutlineElement[] subPackageElements=elements[i].getChildren();
for(int j=0; j< subPackageElements.length; j++){
if(subPackageElements[j] instanceof VhdlSubprogram) {
if(subPackageElements[j].getName().toLowerCase().startsWith(replace.toLowerCase())){
VhdlSubprogramProposalProvider proposalProvider=
new VhdlSubprogramProposalProvider(doc,(VhdlSubprogram)subPackageElements[j],offset,length);
HdlTemplateProposal proposal=proposalProvider.createProposal();
matchList.add(proposal);
}
}
}
}