Make effective discovery the default for type/member -D; drop empty sections#325
Merged
Conversation
…aging
Effective discovery (-D --effective) over-reported sections whose CanRender
is a coarse proxy (e.g. Custom Attributes, gated on a type having methods)
but which render no table at the type level. Add a section render-probe
(RestrictToRenderedSections) that drops tabular schema sections producing no
rendered table, reusing the output already used for column narrowing.
Querying a valid-but-empty section now reports a clear note
("section '<X>' has no data for this type", exit 0) instead of a misleading
"not found". Unknown sections still report not-found with suggestions.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… opt-out Plain -D/--discover for the type and member commands now defaults to effective discovery (resolve source, list only sections/columns with data), fixing the footgun where the static schema advertised sections a type can never populate (e.g. Custom Attributes). The new --schema flag opts back out to the cheap, offline static schema listing. - ApiOptions: add Schema + computed EffectiveDiscovery (Discover != null && !Schema). Gates in ApiCommand/TypeCommand/MemberCommand use it. - SharedOptions: register --schema; ParseSchema warns only when --schema and an explicit --effective conflict during discovery. - Scope limited to type/member; package/assembly keep static-by-default with --effective opt-in (their effective path is a full inspection). - --effective still accepted (now redundant for type/member). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Convert mid-line asterisk emphasis to underscore to match the file's enforced emphasis style. 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.
Summary
Improves the discovery (
-D/--discover) UX for thetypeandmembercommands so that discovery advertises what you can actually query, not a static superset.Two related changes:
Drop empty sections from effective discovery + clearer messaging (
88b4f22)Custom Attributessection that a type cannot populate).note: section '<X>' has no data for this type(exit 0) instead of the misleadingError: Section '<X>' not found.Make effective discovery the default; add
--schemaopt-out (cbab5c0)-D/-D <Section>fortype/membernow defaults to effective discovery (resolve source, list only sections with data), fixing the footgun where the static schema advertised sections a type can never have (e.g.Custom Attributes).--schemaflag opts back out to the cheap, offline static schema listing.--effectiveis still accepted (now redundant for type/member);--effective --schemaresolves to--schemawith a warning (only during discovery).Scope
type/member(ApiOptions).package/assemblykeep their existing static-by-default +--effectiveopt-in behavior, because their effective path runs a full-package inspection (cost/offline regression risk).Behavior
type <T> -Dtype <T> -D --schematype <T> -D --effectivetype -D(no source)package <P> -DTests
--schemarestores the full static list;--schemaparses to opt out of effective discovery; bare/no-source stays static.Schema = trueexplicitly.ILDisassemblerComparisonTestsfailures (missingilspycmd).Docs
docs/design/schema-query.mdupdated for the new default +--schema.