Warning RS1014 'ClassDeclarationSyntax' is immutable and 'AddBaseListTypes' will not have any effect on it. Consider using the return value from 'AddBaseListTypes'.
Many objects exposed by Roslyn are immutable. The return value from a method invocation on these objects should not be ignored.
Roslyn have analyzers for usage of tree modification api: https://github.com/dotnet/roslyn-analyzers/blob/main/src/Microsoft.CodeAnalysis.Analyzers/RulesMissingDocumentation.md?plain=1#L18
Today I spend some time for searching bug in this code:
Same code in Roslyn return diagnostic: