- Notifications
You must be signed in to change notification settings - Fork2.1k
Cleanup analyzers#9666
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Cleanup analyzers#9666
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
This PR modernizes Orleans analyzer implementations by migrating from syntax-based analysis to semantic-based analysis using symbols. This improves reliability and follows analyzer best practices by avoiding error-prone syntax parsing.
Key changes:
- Migration from
SyntaxNodeAnalysisContexttoSymbolAnalysisContextacross multiple analyzers - Introduction of new
SymbolHelpersutility class for semantic operations - Removal of unused syntax-based helper methods from
SyntaxHelpers
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
test/Analyzers.Tests/AbstractPropertiesCannotBeSerializedAnalyzerTest.cs | Removed UTF-8 BOM character |
src/Orleans.Analyzers/SyntaxHelpers.cs | Removed unused syntax-based helper methods and made remaining methods private |
src/Orleans.Analyzers/SymbolHelpers.cs | New utility class with semantic-based helper methods |
src/Orleans.Analyzers/SerializationAttributesHelper.cs | Updated to use symbol-based analysis and removed unused properties |
src/Orleans.Analyzers/NoRefParamsDiagnosticAnalyzer.cs | Migrated from syntax to symbol analysis |
src/Orleans.Analyzers/IncorrectAttributeUseAnalyzer.cs | Migrated from syntax to symbol analysis |
src/Orleans.Analyzers/IdClashAttributeAnalyzer.cs | Migrated from syntax to symbol analysis with improved type safety |
src/Orleans.Analyzers/GrainInterfaceMethodReturnTypeDiagnosticAnalyzer.cs | Migrated from syntax to symbol analysis and simplified type checking |
src/Orleans.Analyzers/GenerateGenerateSerializerAttributeAnalyzer.cs | Migrated from syntax to symbol analysis |
src/Orleans.Analyzers/GenerateAliasAttributesAnalyzer.cs | Migrated from syntax to symbol analysis |
src/Orleans.Analyzers/AtMostOneOrleansConstructorAnalyzer.cs | Migrated from syntax to symbol analysis with improved constructor counting |
src/Orleans.Analyzers/AlwaysInterleaveDiagnosticAnalyzer.cs | Migrated from syntax to symbol analysis |
src/Orleans.Analyzers/AliasClashAttributeAnalyzer.cs | Migrated from syntax to symbol analysis |
src/Orleans.Analyzers/AbstractPropertiesCannotBeSerializedAnalyzer.cs | Migrated to operation-based analysis |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Current implementation of analyzers relies on syntax when it really needs semantics. This is a bad practice and is very error prone.
This PR modernizes few analyzer implementations to follow better practices and be more solid. There is much more to cleanup, but it's a good step so far.