Repository navigation
Give plugin errors W codes and module resolution M036 (#1968) - #2032
Merged
Merged
Conversation
Plugin errors shared P001-P011 with parse errors, and ModuleError::ModuleResolution shared M033 with LoadError::FileRootSelfImport. Move the whole plugin family to the W prefix (keeping numbers) and ModuleResolution, the later assignment, to M036. Replace the compiler-only uniqueness check with a workspace test that discovers every code assignment (code() arms, miette attributes, CODE constants) in non-test sources, so new error enums are covered without registration. Update docs citing plugin codes; authoring-plugins now cites W001 (InvalidExternSignature) for the bare-binding rule instead of P005.
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.
Warning
This content was written by an AI agent and must be verified by a human developer. After human verification, this alert may be removed.
Summary
Fixes #1968: several stable diagnostic codes were each assigned to two different errors.
P0nntoW0nn(numbers kept, whole family includingP010).Pstays with parse errors, which are older and more numerous.ModuleError::ModuleResolutionmoves fromM033toM036.LoadError::FileRootSelfImportkeepsM033, since it was assigned first (Reject file-root self-imports #1532); the collision came in with Give compile-time diagnostics their own codes and typed payloads (follow-up S14–S15) #1933.crates/graphcal-project/tests/diagnostic_codes.rs: discovers every code assignment in non-test sources acrosscrates/*/src(code()arms, miettecode(...)attributes,CODEconstants) and asserts each code has exactly one site and each file uses one prefix. New error enums are covered without registration. Verified it fails on the reintroducedM033collision. The compiler-only uniqueness loop is removed; its pinned-code test also pinsM036,W001,W010.extern-functions.mdcites theWcodes.authoring-plugins.mdsaidP005/P016; the bare-binding rule actually reportsInvalidExternSignature, so it now saysW001/P016.Out of scope: LSP-emitted literal codes (
A001, and the deliberateE001reuse) are not enum definitions and are not scanned.AI assistance
just lint/just test.Breaking changes
breaking changelabel is applied