-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Fix cref tags on generated VB's SyntaxFactory #62578
Conversation
@@ -617,7 +617,7 @@ Public MustInherit Class WriteUtils | |||
text = XmlEscape(text) | |||
Else | |||
' Ensure the text does not require escaping. | |||
Dim filtered = text.Replace("<cref ", "").Replace("/>", "").Replace("&", "").Replace("<", "").Replace(">", "") | |||
Dim filtered = text.Replace("<see ", "").Replace("/>", "").Replace("&", "").Replace("<", "").Replace(">", "") |
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.
shouldn't this be "<see cref=", ""
?
tbh, i'm not really sure what is going on here...
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.
The logic in XmlEscape
on next line only looks for &
, <
and >
. It doesn't look for =
or "
.
So I think this is 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.
It looks like the result of this transformation is only used for a debug assert. e.g., if user says "don't escape the text", then verify in an ad-hoc manner that the text didn't require escaping.
Basically, since "cref" itself doesn't need to be escaped, we don't need to check for it and replace here.
@@ -617,7 +617,7 @@ Public MustInherit Class WriteUtils | |||
text = XmlEscape(text) | |||
Else | |||
' Ensure the text does not require escaping. | |||
Dim filtered = text.Replace("<cref ", "").Replace("/>", "").Replace("&", "").Replace("<", "").Replace(">", "") | |||
Dim filtered = text.Replace("<see ", "").Replace("/>", "").Replace("&", "").Replace("<", "").Replace(">", "") |
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.
Dim filtered = text.Replace("<see ", "").Replace("/>", "").Replace("&", "").Replace("<", "").Replace(">", "") | |
Dim filtered = text.Replace("<see cref ", "").Replace("/>", "").Replace("&", "").Replace("<", "").Replace(">", "") |
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.
@jcouv - I agree with Cyrus. I think this line needs to be adjusted as shown.
@dotnet/roslyn-compiler for review (small change affecting xml docs in some of our code generators) |
* upstream/main: (53 commits) Remove 'mangleName' parameter in PENamedTypeSymbolNonGeneric (dotnet#62813) Produce errors for 'partial file record' (dotnet#62686) [EnC] Allow renaming methods, properties, events etc. (dotnet#62364) Update AbstractFileHeaderDiagnosticAnalyzer.cs Rename file Make static Move tests Refactor Support ref field assignment in object initializers (dotnet#62584) Fix cref tags on generated VB's SyntaxFactory (dotnet#62578) Simplify Simplify Simplify Simplify Simplify Simplify Simplify Simplify Move helper methods Remove serialization ...
FYI @GitHubber17