public static async Task <(IEnumerable <Accessor> outputs, IEnumerable <Accessor> inputs)> GetAccessors(Document document, CSharpSyntaxNode syntaxNode, CancellationToken cancellationToken) { var solution = document.Project.Solution; var syntaxTree = syntaxNode.SyntaxTree; var semanticModel = await solution.GetDocument(syntaxTree).GetSemanticModelAsync(); var methodDeclaration = syntaxNode.FirstParentOrSelfOfType <BaseMethodDeclarationSyntax>(); var methodSymbol = semanticModel.GetDeclaredSymbol(methodDeclaration, cancellationToken); //var l = methodDeclaration.Body.GetLocation(); //var tt = semanticModel.LookupSymbols(l.SourceSpan.Start); //foreach (StatementSyntax S in methodDeclaration.Body.Statements) //{ // var d = S.GetLeadingTrivia(); // var f = S.GetTrailingTrivia(); //} IEnumerable <Accessor> leftAccessors = GetLeftAccessor(methodSymbol).ToList(); IEnumerable <Accessor> rightAccessors = GetRightAccessors(methodSymbol).ToList(); if (syntaxNode is ObjectCreationExpressionSyntax objectCreation) { var typeInfo = semanticModel.GetTypeInfo(objectCreation); leftAccessors = new[] { new Accessor(typeInfo.Type, Accessor.SpecialNameReturnType, true) }; } return(leftAccessors, rightAccessors); }