Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable File Scoped Namespaces For Resources #6881

Merged
merged 6 commits into from
Sep 29, 2021

Conversation

benvillalobos
Copy link
Member

@benvillalobos benvillalobos commented Sep 22, 2021

Fixes #6828

Context

CreateCSharpManifestResourceName uses a c# file parser to extract the namespace and classname to create its resource name. See the original issue for a clear explanation on how this breaks with file-scoped namespaces.

Changes Made

Modify the state machine within the csharp parser to stop looking for a namespace when we encounter a semicolon.

Testing

  • Add tests for this

Notes

Review the final diff

Because of the way the csharparser was written,
we can easily modify the state machine to stop looking
for a namespace when we see a semicolon
@Forgind Forgind added the merge-when-branch-open PRs that are approved, except that there is a problem that means we are not merging stuff right now. label Sep 27, 2021
@benvillalobos benvillalobos merged commit 9881f46 into dotnet:main Sep 29, 2021
@benvillalobos benvillalobos deleted the filescopednamespace-fix branch September 29, 2021 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-when-branch-open PRs that are approved, except that there is a problem that means we are not merging stuff right now.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CreateCSharpManifestResourceName produces wrong result due to being unable to parse file-scoped namespaces
3 participants