I'm writing a Roslyn code fix and I want to replace an identifier token. To do that I'm finding the token and then creating a new one
var newToken = SyntaxFactory.Token(identifierToken.LeadingTrivia, SyntaxKind.IdentifierToken, newName, newName, identifierToken.TrailingTrivia);
However, at run time I'm getting this error
System.ArgumentException: Use Roslyn.Compilers.CSharp.Syntax.Identifier or Roslyn.Compilers.CSharp.Syntax.VerbatimIdentifier to create identifier tokens.
I hunted down the package for that and found that it was now unlisted. I assume that I'm using a lot of old Roslyn stuff because the templates are old. I went and ran a wholesale nuget update against the project but that didn't seem to work very well. What is the modern approach for this? Are there any updated analyzer template floating around out there?
SyntaxFactory.Identifier(...) and SyntaxFactory.VerbatimIdentifier(...) are what you are looking for.