List<CodeFragmentFactory> (@Nullable PsiElement context) { DefaultCodeFragmentFactory defaultFactory = DefaultCodeFragmentFactory.getInstance(); List<CodeFragmentFactory> suitableFactories = new SmartList<>(); CodeFragmentFactory.EXTENSION_POINT_NAME.forEachExtensionSafe(factory -> { if (factory != defaultFactory && factory.isContextAccepted(context)) { suitableFactories.add(factory); } }); suitableFactories.add(defaultFactory); // let default factory be the last one return suitableFactories; }