public void Execute(ISolution solution, ITextControl textControl) { // Physical tree modifications are allowed under transaction only! var transactions = myMethodDeclaration.GetPsiServices().Transactions; transactions.Execute(GetType().Name, () => { using (WriteLockCookie.Create()) { AttributeUtil.AddAttributeToSingleDeclaration(myMethodDeclaration, KnownTypes.BurstDiscardAttribute, myMethodDeclaration.GetPsiModule(), CSharpElementFactory.GetInstance(myMethodDeclaration)); } }); }