use of com.intellij.psi.xml.XmlEntityDecl in project intellij-community by JetBrains.
the class DtdCompletionContributor method addEntityCompletions.
private static void addEntityCompletions(@NotNull final CompletionResultSet result, PsiElement position) {
final PsiElementProcessor processor = new PsiElementProcessor() {
@Override
public boolean execute(@NotNull final PsiElement element) {
if (element instanceof XmlEntityDecl) {
final XmlEntityDecl xmlEntityDecl = (XmlEntityDecl) element;
String name = xmlEntityDecl.getName();
if (name != null && xmlEntityDecl.isInternalReference()) {
result.addElement(LookupElementBuilder.create(name).withInsertHandler(XmlCompletionContributor.ENTITY_INSERT_HANDLER));
}
}
return true;
}
};
XmlUtil.processXmlElements((XmlFile) position.getContainingFile().getOriginalFile(), processor, true);
}
Aggregations