Skip to content
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 analyzer exception 'Syntax node is not within syntax tree' #307

Merged
merged 2 commits into from
May 6, 2024

Conversation

allantargino
Copy link
Member

During orchestration method analysis, since the syntax tree of the callee method might be different from the caller method, we need to get the correct semantic model when they differ.

@allantargino allantargino requested review from jviau and bachuv May 6, 2024 18:26
@allantargino
Copy link
Member Author

The exception was:

AzureFunctionsApp.cs(26,38): warning DURABLE0001: The method 'RunOrchestrator' uses 'System.DateTime.Now' that may cause non-deterministic behavior when invoked from orchestration 'AzureFunctionsApp' 
CSC : warning AD0001: Analyzer 'Microsoft.DurableTask.Analyzers.Orchestration.DateTimeOrchestrationAnalyzer' threw an exception of type 'System.ArgumentException' with message 'Syntax node is not within syntax tree'. 

For reference, helped with the fix: dotnet/roslyn#18730

During orchestration method analysis, since the syntax tree of the callee method might be different from the caller method, we need to get the correct semantic model when they differ
Copy link
Contributor

@bachuv bachuv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the test!

@allantargino allantargino merged commit aa810cc into microsoft:main May 6, 2024
2 checks passed
@allantargino allantargino deleted the fix-syntax-tree-error branch May 6, 2024 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants