Skip to content

Adding C#, F#, VB to StringSyntaxAttribute#123211

Merged
stephentoub merged 5 commits intodotnet:mainfrom
HakamFostok:issue-122604
Jan 17, 2026
Merged

Adding C#, F#, VB to StringSyntaxAttribute#123211
stephentoub merged 5 commits intodotnet:mainfrom
HakamFostok:issue-122604

Conversation

@HakamFostok
Copy link
Contributor

Adding 3 constants that represent C#, F#, and Visual Basic to the StringSyntaxAttribute

Fix #122604

Adding 3 constants that represent C#, F#, and Visual Basic to the StringSyntaxAttribute

Fix dotnet#122604
Copilot AI review requested due to automatic review settings January 15, 2026 11:32
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jan 15, 2026
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jan 15, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds support for three .NET programming language syntax identifiers to the StringSyntaxAttribute class.

Changes:

  • Added three new syntax identifier constants (CSharp, FSharp, VisualBasic) to StringSyntaxAttribute for programming language code
  • Added corresponding test cases to verify the new constants can be used with the attribute

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/StringSyntaxAttribute.cs Added three new const string fields for C#, F#, and VB.NET syntax identifiers
src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Diagnostics/CodeAnalysis/StringSyntaxAttributeTests.cs Added test coverage for the three new syntax identifier constants

@huoyaoyuan huoyaoyuan added area-System.Diagnostics and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Jan 15, 2026
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @steveisok, @dotnet/area-system-diagnostics
See info in area-owners.md if you want to be subscribed.

@huoyaoyuan
Copy link
Member

The ref source (https://github.com/dotnet/runtime/blob/main/src/libraries/System.Runtime/ref/System.Runtime.cs) also needs to be updated when new API is added.

@HakamFostok
Copy link
Contributor Author

Hi @huoyaoyuan

I am a first-time contributor to .NET, so please excuse me if I ask some obvious questions

If I understood correctly, you are saying that I have to add this

image

I will push a commit to update this, if this is what is needed
Thanks

Update the ref source, as requested by this comment on the PR: dotnet#123211 (comment)
Order the constant names alphabetically
Order the constant names alphabetically in UnitTest and StringSyntaxAttribute
Change 'VB.NET' to 'Visual Basic'
Fix Comments
@HakamFostok
Copy link
Contributor Author

Hi @huoyaoyuan
Could you please review this PR
I think the merge is pending on that
Thanks a lot

@huoyaoyuan
Copy link
Member

There's no further issue. I'm not official team member and Stephen is sufficient for deciding.

@HakamFostok
Copy link
Contributor Author

Ok, thanks a lot for letting me know, the tag 'member' beside your name, and your ability to remove and add labels led me to think like that.
Anyway, thanks for the clarification, have a nice day

@stephentoub
Copy link
Member

/ba-g unrelated db failure

@stephentoub stephentoub merged commit 1993c22 into dotnet:main Jan 17, 2026
140 of 147 checks passed
rosebyte pushed a commit that referenced this pull request Jan 19, 2026
Adding 3 constants that represent C#, F#, and Visual Basic to the
StringSyntaxAttribute

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

Labels

area-System.Diagnostics community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API Proposal]: adding C# option to the [StringSyntaxAttribute]

5 participants