I repeat methods in a type and must rewrite those that are not static. I would have to insert the parameter either as the first or the last parameter, but I cannot figure out how to create a ParameterSyntax object
This is what I still have
var methods = from m in r.Members.OfType<MethodDeclarationSyntax>() where !m.Modifiers.Contains(Syntax.Token(SyntaxKind.StaticKeyword)) select new { orgMethodDecl = m, rewrittenDecl = RewriteMethodDeclaration(m,name)}; var rewrittenType = r; foreach(var m in methods){ rewrittenType = rewrittenType.ReplaceNode(m.orgMethodDecl, m.rewrittenDecl); }
and RewriteMethodDeclaration has a problem
MethodDeclarationSyntax RewriteMethodDeclaration(MethodDeclarationSyntax method, string name) { var p = Syntax.Parameter();
source share