void (@NotNull CompletionParameters parameters, @NotNull ProcessingContext context, @NotNull CompletionResultSet result) { final XPathElement parent = PsiTreeUtil.getParentOfType(parameters.getPosition(), XPathElement.class); assert parent != null; if (parent.getParent() instanceof XPath2TreatAs || parent.getParent() instanceof XPath2InstanceOf) { addResult(result, CompletionLists.getNodeTypeCompletions(parent), parameters); } final NamespaceContext namespaceContext = parent.getXPathContext().getNamespaceContext(); if (namespaceContext != null) { final String prefixForURI = namespaceContext.getPrefixForURI(XPath2Type.XMLSCHEMA_NS, parent.getXPathContext().getContextElement()); if (prefixForURI != null && prefixForURI.length() > 0) { addResult(result, ContainerUtil.map(XPath2Type.SchemaType.listSchemaTypes(), type -> new MyLookup(prefixForURI + ":" + type.getQName().getLocalPart())), parameters); } } }