Add HelpLinkUri to Roslyn analyzer diagnostics#548
Conversation
Co-authored-by: YunchuWang <12449837+YunchuWang@users.noreply.github.com>
|
@copilot update helplink to this https://go.microsoft.com/fwlink/?linkid=2346202 |
There was a problem hiding this comment.
Pull request overview
This PR adds help link URIs to all Roslyn analyzer diagnostic descriptors, making it easier for users to understand code constraint violations by providing direct links to relevant documentation. The change systematically updates 15 diagnostic descriptors across 13 analyzer files and adds comprehensive test coverage to ensure all diagnostics have properly formatted help links.
Key Changes
- Added
helpLinkUriparameter to allDiagnosticDescriptorinstantiations pointing to Microsoft Learn documentation with diagnostic-specific anchors - Created
DiagnosticDescriptorTestsclass with parameterized test to validate help link presence and format across all analyzers - Help links follow the pattern:
https://learn.microsoft.com/azure/azure-functions/durable/durable-functions-code-constraints?tabs=csharp#{DiagnosticId}
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/Analyzers.Tests/DiagnosticDescriptorTests.cs | New test file that validates all diagnostic descriptors have properly formatted help links |
| src/Analyzers/Orchestration/ThreadTaskOrchestrationAnalyzer.cs | Added help link to DURABLE0004 diagnostic |
| src/Analyzers/Orchestration/IOOrchestrationAnalyzer.cs | Added help link to DURABLE0005 diagnostic |
| src/Analyzers/Orchestration/GuidOrchestrationAnalyzer.cs | Added help link to DURABLE0002 diagnostic |
| src/Analyzers/Orchestration/EnvironmentOrchestrationAnalyzer.cs | Added help link to DURABLE0006 diagnostic |
| src/Analyzers/Orchestration/DelayOrchestrationAnalyzer.cs | Added help link to DURABLE0003 diagnostic |
| src/Analyzers/Orchestration/DateTimeOrchestrationAnalyzer.cs | Added help link to DURABLE0001 diagnostic |
| src/Analyzers/Functions/Orchestration/OtherBindingsOrchestrationAnalyzer.cs | Added help link to DURABLE0008 diagnostic |
| src/Analyzers/Functions/Orchestration/CancellationTokenOrchestrationAnalyzer.cs | Added help link to DURABLE0007 diagnostic |
| src/Analyzers/Functions/AttributeBinding/OrchestrationTriggerBindingAnalyzer.cs | Added help link to DURABLE1001 diagnostic |
| src/Analyzers/Functions/AttributeBinding/EntityTriggerBindingAnalyzer.cs | Added help link to DURABLE1003 diagnostic |
| src/Analyzers/Functions/AttributeBinding/DurableClientBindingAnalyzer.cs | Added help link to DURABLE1002 diagnostic |
| src/Analyzers/Activities/MatchingInputOutputTypeActivityAnalyzer.cs | Added help links to DURABLE2001 and DURABLE2002 diagnostics |
| src/Analyzers/Activities/FunctionNotFoundAnalyzer.cs | Added help links to DURABLE2003 and DURABLE2004 diagnostics |
|
@copilot update all links to this link instead https://go.microsoft.com/fwlink/?linkid=2346202, we need to use this link |
Co-authored-by: YunchuWang <12449837+YunchuWang@users.noreply.github.com>
Updated all HelpLinkUri values to use https://go.microsoft.com/fwlink/?linkid=2346202 in commit 5bcc25e. |
This change was already completed in commit 5bcc25e. All HelpLinkUri values now use https://go.microsoft.com/fwlink/?linkid=2346202. |
|
@copilot update pr description to follow .github/PULL_REQUEST_TEMPLATE.md |
Here's the updated PR description following the template: SummaryWhat changed?
Why is this change needed?Roslyn analyzer diagnostics lacked help links, making it harder for users to understand code constraint violations. Adding help links provides direct access to documentation explaining the constraints and how to resolve violations. Issues / work items
Project checklist
AI-assisted code disclosure (required)Was an AI tool used? (select one)
If AI was used:
AI verification (required if AI was used):
TestingAutomated tests
Manual validation (only if runtime/behavior changed)
Notes for reviewersDiagnostics updated:
The help link uses a go.microsoft.com redirect for easier future management of the target documentation URL. |
|
cant find where is helplink in visual studio for any diagnostic? is it not showing in visual studio at all? |
Roslyn analyzer diagnostics lacked help links, making it harder for users to understand code constraint violations.
Changes
Added
helpLinkUriparameter to all 15DiagnosticDescriptorinstances across 13 analyzer files:Links point to Durable Functions code constraints documentation using a centralized go.microsoft.com redirect link for easier management.
Diagnostics updated:
Added
DiagnosticDescriptorTeststo validate HelpLinkUri presence and format for all analyzers.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.