void (final Editor editor) { String prefix = myNameSuggestionsField.getEnteredName(); final PsiReference reference = myTag.getReference(); if (reference instanceof TagNameReference) { LookupElement[] lookupItems = TagNameReferenceCompletionProvider.getTagNameVariants(myTag, myTag.getNamespacePrefix()); editor.getCaretModel().moveToOffset(prefix.length()); editor.getSelectionModel().removeSelection(); LookupManager.getInstance(getProject()).showLookup(editor, lookupItems, prefix); } }