-
Notifications
You must be signed in to change notification settings - Fork 549
fix(tree): walk allowed types #24820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a unified AnnotatedAllowedSchema
abstraction for carrying per-type metadata and switches schema traversal and context wiring to use these annotated types. Key changes include:
- Defining the
AnnotatedAllowedSchema
interface and replacing the old Map-based metadata API with aReadonlySet<AnnotatedAllowedSchema>
returned bynormalizeAnnotatedAllowedTypes
. - Refactoring
FieldSchemaAlpha
, node-kind modules (object
,map
,array
,leaf
), and core traversal (walkAllowedTypes
/walkNodeSchema
) to consume and propagate annotated schemas. - Updating consumers (e.g.,
Context
,TreeViewConfiguration
,SchematizingSimpleTreeView
) to pass and handle annotated allowed schemas instead of raw type sets.
Reviewed Changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
packages/dds/tree/src/simple-tree/schemaTypes.ts | Added normalizeAnnotatedAllowedTypes , removed Map-based extractor, updated FieldSchemaAlpha to use annotated Set. |
packages/dds/tree/src/simple-tree/core/walkSchema.ts | Updated walkAllowedTypes and walkNodeSchema to traverse AnnotatedAllowedSchema . |
packages/dds/tree/src/simple-tree/core/context.ts | Changed Context /HydratedContext constructors to accept annotated schemas. |
packages/dds/tree/src/simple-tree/node-kinds/{object,map,array}/… | Exposed childAnnotatedAllowedTypes on all node‐kind static schemas. |
packages/dds/tree/src/simple-tree/createContext.ts | Passage of annotatedAllowedTypeSet into Context for unhydrated contexts. |
Comments suppressed due to low confidence (3)
packages/dds/tree/src/simple-tree/schemaTypes.ts:553
- [nitpick] Derive the identifiers from the
lazyAnnotatedTypes
value to keep them in sync with any filtering or ordering innormalizeAnnotatedAllowedTypes
. For example:
this.lazyIdentifiers = new Lazy(
() => new Set(
[...this.lazyAnnotatedTypes.value].map(a => a.type.identifier),
),
);
this.lazyIdentifiers = new Lazy(() => new Set([...this.allowedTypeSet].map((t) => t.identifier)),
packages/dds/tree/src/simple-tree/core/context.ts:54
- Add or update the JSDoc above the constructor to reflect that
rootSchema
now accepts anIterable<AnnotatedAllowedSchema>
(including metadata), not rawTreeNodeSchema
instances.
public constructor(
packages/dds/tree/src/simple-tree/schemaTypes.ts:564
- Enhance the JSDoc for
annotatedAllowedTypeSet
to explicitly state it returns aReadonlySet<AnnotatedAllowedSchema>
where each entry contains both the evaluated schema and its associated metadata, replacing any mention of the former Map-based return type.
public get annotatedAllowedTypeSet(): ReadonlySet<AnnotatedAllowedSchema> {
Co-authored-by: Craig Macomber (Microsoft) <42876482+CraigMacomber@users.noreply.github.com>
Co-authored-by: Craig Macomber (Microsoft) <42876482+CraigMacomber@users.noreply.github.com>
Co-authored-by: Craig Macomber (Microsoft) <42876482+CraigMacomber@users.noreply.github.com>
Co-authored-by: Craig Macomber (Microsoft) <42876482+CraigMacomber@users.noreply.github.com>
Co-authored-by: Craig Macomber (Microsoft) <42876482+CraigMacomber@users.noreply.github.com>
Co-authored-by: Craig Macomber (Microsoft) <42876482+CraigMacomber@users.noreply.github.com>
Co-authored-by: Craig Macomber (Microsoft) <42876482+CraigMacomber@users.noreply.github.com>
…luidFramework into fix-walk-allowed-types
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output
|
Description
childTypes
API