-
Notifications
You must be signed in to change notification settings - Fork 408
Avoid duplicating My in settings type if no root namespace exists #8888
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
Avoid duplicating My in settings type if no root namespace exists #8888
Conversation
| End If | ||
|
|
||
| If defaultNamespace <> "" Then | ||
| If defaultNamespace <> "" And Not defaultNamespace.Equals(MyNamespaceName) Then ' defaultNamespace, if none exists, will come in thru wszDefaultNamespace as My. We don't want to duplicate it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took a look at the blame for this. Looks like you added the if-statement above this one for projectRootNamespace. So, is My being duplicated because your new if-statement prior to this has projectRootNamespace set to My? Then this if-statement was also executing causing My.My for fullTypeName?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Relevant snippet:
There was a line that checks whether default namespace is empty, and if so does not append it to the generated type. So my assumption when modifying the file was that meant that having no default namespace would mean that the default namespace passed into the generator would be “”
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summoning a Ballad by Paul Vick:
| If defaultNamespace <> "" And Not defaultNamespace.Equals(MyNamespaceName) Then ' defaultNamespace, if none exists, will come in thru wszDefaultNamespace as My. We don't want to duplicate it. | |
| If defaultNamespace <> "" AndAlso Not defaultNamespace.Equals(MyNamespaceName) Then ' defaultNamespace, if none exists, will come in thru wszDefaultNamespace as My. We don't want to duplicate it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. Will add
drewnoakes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a bug we can link this to, or repro steps to get into the state you are trying to prevent? The fix seems fine, but it's a bit abstract without that extra detail.
Fixes AB#1741242
If the user has not defined a default namespace in VB .net framework, it will default to "My". We want to avoid My.My. being generated in the file generator.
Microsoft Reviewers: Open in CodeFlow