PsiElement[] (@NotNull Surrounder surrounder) { List<SurroundDescriptor> surroundDescriptors = LanguageSurrounders.INSTANCE.allForLanguage(getFile().getViewProvider().getBaseLanguage()); String surrounderDescription = surrounder.getTemplateDescription(); for (SurroundDescriptor descriptor : surroundDescriptors) { Surrounder[] surrounders = descriptor.getSurrounders(); for (Surrounder surrounderInDescriptor : surrounders) { if (surrounderInDescriptor.getTemplateDescription().equals(surrounderDescription)) { SelectionModel selection = getEditor().getSelectionModel(); PsiElement[] elements = descriptor.getElementsToSurround( getFile(), selection.getSelectionStart(), selection.getSelectionEnd()); return elements; } } } return null; }