private static EqualsValueClauseSyntax GetFieldInitialization(VariableDeclaratorSyntax fieldVariableDeclaratorSyntax) { var declaration = fieldVariableDeclaratorSyntax.AncestorsAndSelf().OfType <VariableDeclarationSyntax>().First(); if (declaration == null) { return(null); } var variableWithPotentialInitializer = declaration.Variables.SkipWhile(v => v != fieldVariableDeclaratorSyntax).FirstOrDefault(v => v.Initializer != null); if (variableWithPotentialInitializer == null) { return(null); } var initializer = variableWithPotentialInitializer.Initializer; return(initializer); }