in Backend/Core/ForTea.Core/Psi/T4CSharpCustomModificationHandler.cs [296:308]
private static void RemoveContainingBlockIfEmpty([CanBeNull] ITreeNode node)
{
var block = node.GetT4ContainerFromCSharpNode<IT4CodeBlock>();
string code = block?.Code.GetText();
if (code == null || code.Trim().Length == 0)
return;
if (!(block.GetContainingFile() is IT4File file) || node == null) return;
using (WriteLockCookie.Create(file.IsPhysical()))
{
ModificationUtil.DeleteChild(node);
}
}