void (final Facet facet) { WriteAction.runAndWait(() -> { if (!isRegistered(facet)) { return; } ModifiableFacetModel model = FacetManager.getInstance(facet.getModule()).createModifiableModel(); model.removeFacet(facet); model.commit(); }); }