-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
F1 on our source generator errors goes nowhere because we don't set a HelpUri #85181
Comments
BTW clicking many newer compiler error codes also leads to a generic error page like this. |
@buyaa-n how do we handle ensuring that the SYSLIBxxx codes go someplace? |
should ours all pass HelpLinkUri or should there be useful default behavior somewhere? |
I don't know how SYSLIBxxx links works, seems it should open https://learn.microsoft.com/en-us/dotnet/fundamentals/syslib-diagnostics/syslib1050-1069, tagging @gewarren who created that page |
None of the SYSLIB warning links seem to work, even the ones that have a dedicated page (I tried SYSLIB0011 for BinaryFormatter.Serialize). I think this is how the code analysis rules hook up to learn.microsoft.com: https://github.com/dotnet/roslyn-analyzers/blob/2420507acd5863bfe30a7dd97993c9362527045b/src/Utilities/Compiler/DiagnosticDescriptorHelper.cs#L36. @mavasani might be able to suggest a solution for the SYSLIB warnings? |
You should write a DiagnosticDescriptor creation helper in your repo that builds up the help link based on the diagnostic ID and adds it to the descriptor. We do so in both Roslyn and Roslyn-analyzers repo. |
Tagging subscribers to this area: @dotnet/runtime-infrastructure Issue Detailsclicked on the SYSLIB1052 code, which is hyperlinked, and got an Oops page: Not sure if it's just this code.
|
Seems like this is a general analyzer issue for the repo and no specific to interop. |
The DiagnosticDescriptorHelper would need to have a mapping table in order to produce URL's like https://learn.microsoft.com/en-us/dotnet/fundamentals/syslib-diagnostics/syslib1040-1049 a few URL's are missing, dotnet/docs#35297 |
We can do the mapping on the docs side through the redirection file, e.g.
|
Ah, I think that would be much better. So the helper should basically just set HelpUri to |
cc @captainsafia as it appears that the RDG is also missing HelpLinkUri eg and will need a help topic and perhaps a redirect like this dotnet/docs#35301 I can open an issue if there's not already a task tracking that. for reference, aspnetcore's list is at https://github.com/dotnet/aspnetcore/blob/main/docs/list-of-diagnostics.md |
Yep, let's file an issue for this. We currently have the HelpLink uri configured the analyzers/codefixers in the targeting pack but not the generator. |
The fix for this should add a DiagnosticDescriptorHelper class like the one shared by @gewarren (thanks!) with a create method taking relevant constructor parameters, it should create the string helpLink = $"https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/{id.ToLowerInvariant()}.md"; Then create the DiagnosticDescriptor. Looks like we have a few different sources in the repo -- some may not be syslib. @layomia -- maybe you can try this out while you're working on the ConfigurationBinder generator to find a pattern that works well, then apply it across the other generators? |
Tagging subscribers to this area: @dotnet/area-meta Issue Detailsclicked on the SYSLIB1052 code, which is hyperlinked, and got an Oops page: Not sure if it's just this code.
|
Note that despite the title it's not just generators of course, anywhere a DiagnosticDescriptor is created, eg analyzer diagnostics. |
I got this
clicked on the SYSLIB1052 code, which is hyperlinked, and got an Oops page:
https://learn.microsoft.com/en-us/visualstudio/ide/not-in-toc/default?f1url=%3FappId%3DDev16IDEF1%26l%3DEN-US%26k%3Dk(keywords_removed)%26rd%3Dtrue&view=vs-2022
Not sure if it's just this code.
The text was updated successfully, but these errors were encountered: