Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 16, 2025

Obsolete attributes on VB syntax properties showed generic "This member is obsolete." messages without indicating replacement properties, forcing developers to search metadata or documentation.

Changes

Updated 54 obsolete attribute messages across 4 VB syntax files:

  • MethodBlockBaseSyntax.vb: BeginSubNewStatement, EndEndSubStatement, etc. for ConstructorBlock, MethodBlock, and OperatorBlock
  • MethodBaseSyntax.vb: Keyword{Type}Keyword (e.g., SubOrFunctionKeyword, EventKeyword) for 9 statement types
  • TypeBlockSyntax.vb: Begin{Type}Statement, EndEnd{Type}Statement for Class, Structure, Interface, Module blocks
  • TypeStatementSyntax.vb: Keyword{Type}Keyword for Class, Structure, Interface, Module statements

Example

' Before
<Obsolete("This member is obsolete.", True)>
Public Shadows ReadOnly Property Begin As SubNewStatementSyntax

' After
<Obsolete("This member is obsolete. Use SubNewStatement instead.", True)>
Public Shadows ReadOnly Property Begin As SubNewStatementSyntax
Original prompt

This section details on the original issue you should resolve

<issue_title>Obsolete messages could be more helpful</issue_title>
<issue_description>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; }

</issue_description>

<agent_instructions>@copilot look for all these obsolete cases on VB syntax. For example:

ConstructorBlockSyntax ...
        <Obsolete("This member is obsolete.", True)>
        Public Shadows ReadOnly Property Begin As SubNewStatementSyntax

Update the comments to explain which statement to use instead. For example, for ConstructorBlockSyntax you can see that it should be <Obsolete("This member is obsolete. Use BlockStatement instead.", True)>

You only need to update the obsolete messages on VB syntax nodes that do not say which new property to use. </agent_instructions>

Comments on the Issue (you are @copilot in this section)

@jaredpar 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.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…roperties

Co-authored-by: CyrusNajmabadi <4564579+CyrusNajmabadi@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve obsolete messages for clarity in VB syntax Add replacement property names to VB syntax obsolete attributes Nov 16, 2025
Copilot AI requested a review from CyrusNajmabadi November 16, 2025 13:00
Copilot finished work on behalf of CyrusNajmabadi November 16, 2025 13:00
@CyrusNajmabadi CyrusNajmabadi marked this pull request as ready for review November 16, 2025 13:25
@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner November 16, 2025 13:25
@CyrusNajmabadi
Copy link
Member

@dotnet/roslyn-compiler this is ready for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Obsolete messages could be more helpful

2 participants