Hook up doc links to IDExxxx rules#48471
Conversation
Fixes dotnet#41324 I have also done some additional refactoring to combine `AbstractBuiltInCodeStyleDiagnosticAnalyzer` and `AbstractCodeStyleDiagnosticAnalyzer` into a single type.
| DiagnosticSeverity.Hidden, | ||
| isEnabledByDefault: true, | ||
| description: description, | ||
| helpLinkUri: $"https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/{id}", |
There was a problem hiding this comment.
|
Do we now need some way to track missing documentation like roslyn-analyzers repo? |
| DiagnosticSeverity.Hidden, | ||
| isEnabledByDefault: true, | ||
| description: description, | ||
| helpLinkUri: $"https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/{id}", |
There was a problem hiding this comment.
What about the rules that are documented together?
The link for them takes the form of https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/idexxxx-ideyyyy
I'd use the F1 link here.
There was a problem hiding this comment.
What about the rules that are documented together?
We have redirects for these, I verified this will work after my latest open PR is merged.
I'd use the F1 link here.
We considered it, but it does not work for all rule IDs. Also confirmed with @gewarren that we should not rely on msdn redirections for help links.
For context, if I type out https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CA2000) it seems to redirect properly. Doesn't seem to work for all IDs though, for example https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CA1000) took me to the index (not sure if that is only for the first rule though). It doesn't work even for some rule in middle https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CA2234).
There was a problem hiding this comment.
We have redirects for these, I verified this will work after my latest open PR is merged.
Great. There is no problem then if the redirections for these will always be maintained for future rules. 🎉
For context, if I type out https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CA2000) it seems to redirect properly. Doesn't seem to work for all IDs though, for example https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CA1000) took me to the index (not sure if that is only for the first rule though). It doesn't work even for some rule in middle https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CA2234).
Probably the F1 service redirections aren't working because these f1_keywords existed in VS docs. The service seems to have some cache of where each keyword exists. So it should work properly after some time. (This isn't to say we should rely on F1 service, just putting my thought on why it might be not working properly)
Possibly, but not in the scope of this PR. |
| # IDE0047, ArithmeticBinaryParentheses | ||
| dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent |
There was a problem hiding this comment.
Isn't this the expected behavior even before this PR? Was this a bug somewhere that got fixed with this PR? or is there something I'm not seeing?
There was a problem hiding this comment.
Yes, the analyzer was not registering its supported options in its ctor, hence configuration code fixes were not working for it.
|
Hello @mavasani! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
|
Thank you @jmarolf @JoeRobich! |
Fixes #41324
I have also done some additional refactoring to combine
AbstractBuiltInCodeStyleDiagnosticAnalyzerandAbstractCodeStyleDiagnosticAnalyzerinto a single type.