Repository: dotnet/roslyn
File: src/Workspaces/CoreTest/Editing/SyntaxEditorTests.cs (C#)

Code before:

        var editor = GetEditor(cu);
        var methodX = editor.Generator.GetMembers(cls)[0];

        var syntaxGenerator = editor.Generator;
        var args = new[] { syntaxGenerator.AttributeArgument(syntaxGenerator.MemberAccessExpression(syntaxGenerator.DottedName("Sample"), "Attribute")) };
        var attribute = syntaxGenerator.Attribute("Example", args);
        editor.AddReturnAttribute(methodX, attribute);
        var newRoot = editor.GetChangedRoot();

        VerifySyntax<CompilationUnitSyntax>(
            newRoot, """
using System;
using System.CodeAnalysis;

public class C
{
    [return: Example(Sample.Attribute)]
    Type Main(Type t)
    {
    }
}
""");
    }

    [Fact, WorkItem(78860, "https://github.com/dotnet/roslyn/issues/78860")]
    public void TestInsertDelegateIntoInterface()
    {
        var code = """
            public interface ITest
            {
                void Method();
            }
            """;

        var cu = SyntaxFactory.ParseCompilationUnit(code);
        var interfaceDecl = (InterfaceDeclarationSyntax)cu.Members[0];

        var editor = GetEditor(cu);

        // Create a delegate declaration
        var delegateDecl = SyntaxFactory.DelegateDeclaration(
            SyntaxFactory.PredefinedType(SyntaxFactory.Token(SyntaxKind.VoidKeyword)),
            SyntaxFactory.Identifier("MyDelegate"))
            .WithParameterList(SyntaxFactory.ParameterList());

        editor.InsertMembers(interfaceDecl, 0, new[] { delegateDecl });
        var newRoot = editor.GetChangedRoot();

        VerifySyntax<CompilationUnitSyntax>(
            newRoot,

Review comment (suggestion):
```suggestion
    [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/78860")]
```

Code after:

        var editor = GetEditor(cu);
        var methodX = editor.Generator.GetMembers(cls)[0];

        var syntaxGenerator = editor.Generator;
        var args = new[] { syntaxGenerator.AttributeArgument(syntaxGenerator.MemberAccessExpression(syntaxGenerator.DottedName("Sample"), "Attribute")) };
        var attribute = syntaxGenerator.Attribute("Example", args);
        editor.AddReturnAttribute(methodX, attribute);
        var newRoot = editor.GetChangedRoot();

        VerifySyntax<CompilationUnitSyntax>(
            newRoot, """
using System;
using System.CodeAnalysis;

public class C
{
    [return: Example(Sample.Attribute)]
    Type Main(Type t)
    {
    }
}
""");
    }

    [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/78860")]
    public void TestInsertDelegateIntoInterface()
    {
        var code = """
            public interface ITest
            {
                void Method();
            }
            """;

        var cu = SyntaxFactory.ParseCompilationUnit(code);
        var interfaceDecl = (InterfaceDeclarationSyntax)cu.Members[0];

        var editor = GetEditor(cu);

        // Create a delegate declaration
        var delegateDecl = SyntaxFactory.DelegateDeclaration(
            SyntaxFactory.PredefinedType(SyntaxFactory.Token(SyntaxKind.VoidKeyword)),
            SyntaxFactory.Identifier("MyDelegate"))
            .WithParameterList(SyntaxFactory.ParameterList());

        editor.InsertMembers(interfaceDecl, 0, new[] { delegateDecl });
        var newRoot = editor.GetChangedRoot();

        VerifySyntax<CompilationUnitSyntax>(
            newRoot,