feat(LC0095, LC0099): split unreferenced-parameter rule into LC0095 and LC0099 - #425
Conversation
…nd LC0099 Separate unreferenced parameter diagnostics by procedure kind: - Keep LC0095 for regular non-local procedures (internal/public) - Introduce LC0099 for event subscribers (Info severity) Implement a shared code fix provider for both diagnostics: - Keep scoped equivalence keys for regular procedures and event subscribers - Use custom Fix All with one-pass RemoveNodes on separated parameter lists - Keep fallback behavior when fixAllSpans is empty in document scope Improve maintainability and consistency: - Align naming in tests and fix-all scenarios - Keep netstandard2.1 compatibility behavior intact Expand and update test coverage: - Add and adjust diagnostic, single-fix, and fix-all cases for both scopes - Verify focused ParameterNotReferenced test suite passes
Code reviewReviewed the LC0095/LC0099 split, the CodeFix changes, and the new FixAll implementation. No significant issues found in the core implementation. Summary of what was verified: Builds & tests
FixAll correctness
Plumbing
Question: is deleting the adjacent comment intentional? In Was this a deliberate choice? Our view is that a code fix shouldn't silently delete user comments; the developer should decide whether a comment is still relevant. If you agree, this needs a change (e.g., Related: directive trivia (
|
Summary
This PR splits the previous unreferenced-parameter behavior into two diagnostics with clear scope boundaries:
It also keeps a shared code fix implementation and updates tests and documentation accordingly.
What changed
Analyzer:
Code fix:
Tests:
Why
AA0137 does not cover this full space:
Splitting the diagnostics improves clarity, allows better policy tuning, and keeps fix behavior deterministic.
Validation
Breaking changes
No runtime breaking changes.
Diagnostic behavior changes:
Implements #426