private static string GetFunctionDescription(TypeSyntax returnType, SyntaxToken name, ParameterListSyntax parameterList, bool includeReturnType, bool includeParameterNames) { var result = new StringBuilder(); if (includeReturnType) { result.Append($"{returnType.ToStringIgnoringMacroReferences()} "); } result.Append(name.GetFullyQualifiedName()); result.Append("("); for (var i = 0; i < parameterList.Parameters.Count; i++) { var parameter = parameterList.Parameters[i]; result.Append(parameter.GetDescription(includeParameterNames)); if (i < parameterList.Parameters.Count - 1) { result.Append(", "); } } result.Append(")"); return(result.ToString().Replace(Environment.NewLine, string.Empty)); }
private EditorNavigationTarget CreateTypeTarget(SyntaxToken name, TextSpan nodeSpan, Glyph icon, IEnumerable <SyntaxNode> childNodes) { if (!nodeSpan.IsInRootFile) { return(null); } if (name == null) { return(null); } return(new EditorTypeNavigationTarget(name.GetFullyQualifiedName(), new SnapshotSpan(_snapshot, nodeSpan.Start, nodeSpan.Length), new SnapshotSpan(_snapshot, name.Span.Start, 0), icon, icon.GetImageSource(_glyphService), childNodes.SelectMany(Visit).ToList())); }
private static string GetFunctionDescription(TypeSyntax returnType, SyntaxToken name, ParameterListSyntax parameterList, bool includeReturnType, bool includeParameterNames) { var result = new StringBuilder(); if (includeReturnType) result.Append($"{returnType.ToStringIgnoringMacroReferences()} "); result.Append(name.GetFullyQualifiedName()); result.Append("("); for (var i = 0; i < parameterList.Parameters.Count; i++) { var parameter = parameterList.Parameters[i]; result.Append(parameter.GetDescription(includeParameterNames)); if (i < parameterList.Parameters.Count - 1) result.Append(", "); } result.Append(")"); return result.ToString().Replace(Environment.NewLine, string.Empty); }