var methodDeclarationNode = context.GetNode(methodName);
var firstStatementNode = methodDeclarationNode.Body.Statements.First();The RefactoringContext and related classes are part of the Microsoft.CodeAnalysis package library, which provides APIs for working with C# and Visual Basic .NET source code.