private async Task <string> GetEntryMethod(IMethodStructure startMethod) { await startMethod.ParseMethod(); var caller = startMethod.GetMethodSymbol().ContainingSymbol.ToDisplayString(); return(caller + "." + startMethod.MethodName); }
private async Task <IMethodSymbol> ImplementingMethod(IClassStructure clsImplementing, IMethodSymbol call) { var methodName = call.Name; IMethodStructure method = clsImplementing.Methods.Where(m => m.MethodName == methodName).FirstOrDefault(); await method.ParseMethod(); return(method.GetMethodSymbol()); }
private async Task <string> CreateSequenceDiagramForMethod(IMethodStructure startMethod, int depth) { if (startMethod == null) { throw new MethodNotFoundException("Start method could not be found!"); } InternalMethodStructure internalStartMethod = new InternalMethodStructure(startMethod, true); string entryMethod = await GetEntryMethod(internalStartMethod); WriteHead(entryMethod); ISyntaxDrawerFactory drawerFactory = new SyntaxDrawerFactory(_analyzedClasses, entryMethod, _logger); await internalStartMethod.ParseMethod(); while (internalStartMethod.NodeSymbols.TryDequeue(out (SyntaxNode, ISymbol)nodeSymbol)) { var drawer = drawerFactory.GetDrawer(nodeSymbol.Item1, _ifaceResolver, _diagram); await drawer.WriteDiagramSyntax(nodeSymbol, internalStartMethod, 10, entryMethod); } WriteEnd(entryMethod); return(_diagram.ToString()); }
public bool WriteEndStatement(IMethodStructure currentMethod, SyntaxNode currentNode) { return(Method == currentMethod && currentNode.Span.Start > SpanEnd); }
public bool WriteEndStatement(IMethodStructure currentMethod, int currentSpan) { return(Method == currentMethod && currentSpan >= SpanEnd); }
public StatementScope(IMethodStructure method, SyntaxNode currentNode, string endStatement) { Method = method; SpanEnd = currentNode.Span.End; EndStatement = endStatement; }