Issue919 local functions#920
Conversation
There was a problem hiding this comment.
Pull Request Overview
Adds support for local functions in NUnit analyzer's field disposal and nullability suppression analyzers. This enhancement allows the analyzers to properly detect field assignments and disposal operations that occur within local functions, ensuring consistent analysis behavior across different code patterns.
- Added local function support to the dispose fields analyzer for both assignment and disposal tracking
- Extended nullability suppressor to handle field assignments in local functions
- Added comprehensive test coverage for local function scenarios
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| DisposeFieldsAndPropertiesInTearDownAnalyzer.cs | Added overloads to handle LocalFunctionStatementSyntax for both assignment and disposal tracking |
| NonNullableFieldOrPropertyIsUninitializedSuppressor.cs | Extended type signatures and added local function support for field assignment detection |
| DisposeFieldsAndPropertiesInTearDownAnalyzerTests.cs | Added test cases for local function scenarios and updated variable naming |
| NonNullableFieldOrPropertyIsUninitializedSuppressorTests.cs | Added test case for field assignment in local functions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
mikkelbu
left a comment
There was a problem hiding this comment.
Looks great and seems like a natural addition. I only have very minor nitpick, but I'm happy to merge this when you are.
Great work as usual 👍
…opertyIsUninitializedSuppressor.cs Co-authored-by: Mikkel Nylander Bundgaard <[email protected]>
Fixes #919