Skip to content

Offer the CsSig code fix for CSSIG005 (signature mismatch) - #39

Merged
agocke merged 5 commits into
mainfrom
agocke/cssig005-codefix
Jun 29, 2026
Merged

Offer the CsSig code fix for CSSIG005 (signature mismatch)#39
agocke merged 5 commits into
mainfrom
agocke/cssig005-codefix

Conversation

@agocke

@agocke agocke commented Jun 29, 2026

Copy link
Copy Markdown
Owner

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 format regenerated the owning file. So invoking a fix on a single CSSIG005 in the editor did nothing.

Fix

  • Add DiagId.SignatureMismatch (CSSIG005) to FixableDiagnosticIds. Mismatches always live in a declaring file, so the existing regenerate-owning-file path handles them.
  • Rename the owner action to "Update '' to match project API" (covers add-missing and mismatch).
  • Update doc comment + add CodeFixRegeneratesFileForSignatureMismatch test.

Test

dotnet test test/test/test.csproj — 113 passing.

agocke and others added 5 commits June 28, 2026 18:28
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>
@agocke
agocke merged commit 4f7620c into main Jun 29, 2026
2 checks passed
@agocke
agocke deleted the agocke/cssig005-codefix branch June 29, 2026 01:41
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.

1 participant