dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19.05k stars 4.03k forks source link

Obsolete messages could be more helpful #630

Open jaredpar opened 9 years ago

jaredpar commented 9 years ago

The upgrade from beta1 to rc1 NuGet packages introduced a number of Obsolete members. The messages though are not very helpful:

[Obsolete("This member is obsolete.", true)]
public ClassStatementSyntax Begin { get; }

This just tells the user the member is obsolete but gives them no direction on how to fix the problem. Intellisense is also not helpful here because Begin has no matches. I'm forced to go to the metadata view of the file and search for the new member.

A much better message would be:

[Obsolete("This member is obsolete, use ClassStatement instead", true)]
public ClassStatementSyntax Begin { get; }
jaredpar commented 9 years ago

Also as an aside:

I generally find the move from Begin and End to type specific names results in a loss of productivity. Before when working with rewrites on any block construct I could reliably grab Begin and End to rewrite the tree. Now I have to remember the type specific name for begin and end on every single block construct. That results in a lot of searching when instead I should be coding.

Even if we want to keep type specific notation it would help if the begin construct began with Begin just as the end construct begins with End. This would make it enormously easier to find in intellisense.