boolean (@NotNull PsiElement element) { if (element instanceof PsiFile) return true; if (!element.isPhysical()) return false; RefactoringSupportProvider provider = LanguageRefactoringSupport.INSTANCE.forContext(element); return provider != null && provider.isSafeDeleteAvailable(element); }