Conversation
…es and sub-orchestrations Co-authored-by: YunchuWang <12449837+YunchuWang@users.noreply.github.com>
…eadonly struct, remove unused import Co-authored-by: YunchuWang <12449837+YunchuWang@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add Roslyn Analyzer to detect calling non-existent functions
Add Roslyn Analyzer to detect calls to non-existent functions (name mismatch)
Dec 5, 2025
Member
|
@copilot check and address the comments |
…nested if statements Co-authored-by: YunchuWang <12449837+YunchuWang@users.noreply.github.com>
Contributor
Author
Addressed the code quality suggestions in commit
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a new Roslyn analyzer (FunctionNotFoundAnalyzer) to detect compile-time mismatches when calling activities or sub-orchestrations with names that don't match any defined functions in the compilation. This helps prevent runtime errors caused by typos or incorrect function names.
Key Changes:
- New analyzer detects non-existent activity and sub-orchestration references
- Comprehensive test coverage with 17 test cases covering various scenarios
- Support for multiple registration patterns (Azure Functions attributes, class-based syntax, lambda/func registrations)
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/Analyzers/Activities/FunctionNotFoundAnalyzer.cs |
Core analyzer implementation that tracks function invocations and definitions across the compilation, reporting diagnostics for mismatches |
test/Analyzers.Tests/Activities/FunctionNotFoundAnalyzerTests.cs |
Comprehensive test suite covering activity and sub-orchestration scenarios including Durable Functions, class-based, and lambda registrations |
src/Analyzers/Resources.resx |
Resource strings for diagnostic messages with clear, actionable guidance |
src/Analyzers/AnalyzerReleases.Unshipped.md |
Documentation for new diagnostic rules DURABLE2003 and DURABLE2004 |
Member
YunchuWang
reviewed
Dec 10, 2025
YunchuWang
approved these changes
Dec 10, 2025
torosent
approved these changes
Dec 10, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

FunctionNotFoundAnalyzerthat detects:CallActivityAsyncwith non-existent function namesCallSubOrchestratorAsyncwith non-existent function namesFindOverridingMethodtoClassOverridesMethodreturning boolSystem.Diagnosticsimport.Where(...)LINQ filter in foreach loops for diagnostics.Any(...)inClassOverridesMethodinstead of explicit foreach loopifstatements for TaskActivity derived classes checkOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.