Skip to content

feat: guide quantity encodings and offer safe alias fixes - #33

Merged
ScottishTapWater merged 1 commit into
feat/dimension-diagnosticsfrom
feat/quantity-alias-codefix
Oct 24, 2026
Merged

ScottishTapWater merged 1 commit into
feat/dimension-diagnosticsfrom
feat/quantity-alias-codefix

Conversation

@ScottishTapWater

Copy link
Copy Markdown
Contributor

Stack

Second of three; based on #32 (feat/dimension-diagnostics).

Summary

  • DQ0003 suggests readable quantity aliases, DQ0004 identifies noncanonical encodings, and DQ0005 identifies invalid closed encodings.
  • Allow deliberate aliases and open generics; ignore unresolved types while editing.
  • Add a separate IDE code-fix assembly using the approved Workspaces/Composition dependencies.
  • Apply aliases only when they bind to the same type; preserve trivia and nullable syntax, and withhold fixes inside nameof.
  • Discover raw generic quantity declarations so non-catalogued aliases are available for replacement.
  • Extend package checks and treat analyzer-load/generator-crash warnings as errors in packaged-consumer tests.

Verification

  • Tests written before implementation, including real CodeAction application and recompilation of fixed source.
  • Full suite: 981 passed before final nameof guard; all 30 focused encoding/code-fix/discovery checks passed after that guard.
  • Independent production and test reviews, plus review of the safety fix, passed.
  • Clean build, formatting verification, Release pack/layout check and both packaged-consumer tests passed.
  • IDE code actions tested through Roslyn AdhocWorkspace; not manually exercised in Rider.

@ScottishTapWater
ScottishTapWater merged commit 917f9e3 into main Oct 24, 2026
2 checks passed
@ScottishTapWater
ScottishTapWater deleted the feat/quantity-alias-codefix branch October 24, 2026 20:38
ScottishTapWater added a commit that referenced this pull request Oct 24, 2026
## Summary

Third PR in the analyser stack; based on #33.

- Add DQ0006 warnings for generated aliases that conflict with
declarations or explicit aliases, or displace imported types, including
metadata types and static member uses.
- Preserve existing alias generation and binding behaviour.
- Add DQ0007 errors for invalid unresolved English exponent requests on
the library's `Power<T>.Of` API, while respecting bound names and
unrelated APIs.
- Share planned alias names with the emitter and keep diagnostic
discovery in focused helpers.
- Cover collisions, unchanged binding, cross-file alias scope, invalid
requests, and diagnostic removal after edits.

## Verification

- Full solution test suite passed, including package integration and
quick-fix tests.
- Formatting verification and `git diff --check` passed.
- Independent C# review completed; findings fixed and reviewed again.
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