Offer the CsSig code fix for CSSIG005 (signature mismatch) - #39
Merged
Conversation
The code fix only registered for CSSIG002, so a declared signature that no longer matched the project API (CSSIG005) had no individual lightbulb fix; it was only resolved as a side effect of FixAll/dotnet format regenerating the owning file. Add CSSIG005 to FixableDiagnosticIds and rename the owner action to "Update '<file>' to match project API" (covers add-missing and mismatch). Add a test for the mismatch case. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reporting at error severity blocks build/debug while the public surface is being iterated. Make all CsSig diagnostics warnings by default; consumers can still escalate via .editorconfig / TreatWarningsAsErrors. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Mark regenerated signature files as fixer-owned so they aren't hand-edited. Avoid the literal <auto-generated/> marker: it makes Roslyn treat the file as generated and disable nullable, breaking CSSIG005 source equivalence. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CsSigWriter now emits [System.Obsolete] (with message and error flag) on types and members that declare it, so deprecation is carried into the signature file. Bump package version to 0.3.3. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Problem
The CsSig code fix only registered for CSSIG002 (public member missing from
.cssig). A declared signature that no longer matched the project's public API (CSSIG005) had no individual lightbulb fix — it was only cleared indirectly when FixAll /dotnet formatregenerated the owning file. So invoking a fix on a single CSSIG005 in the editor did nothing.Fix
DiagId.SignatureMismatch(CSSIG005) toFixableDiagnosticIds. Mismatches always live in a declaring file, so the existing regenerate-owning-file path handles them.CodeFixRegeneratesFileForSignatureMismatchtest.Test
dotnet test test/test/test.csproj— 113 passing.