You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`attributes for ${q.qname.localName} in namespace ${q.qname.namespace}`,
@@ -414,13 +451,23 @@ function formatChildrenReport(
414
451
type: SymbolHit,
415
452
children: ChildEdge[],
416
453
profile: string,
454
+
opts: {resolvedFromLocal?: LocalElementHit}={},
417
455
): string{
418
456
constlines: string[]=[];
419
-
constheading=element
420
-
? `Children of ${element.localName} (via type ${type.localName})`
421
-
: `Children of ${type.localName}`;
457
+
constlocal=opts.resolvedFromLocal;
458
+
constheading=local
459
+
? `Children of ${local.localName} (resolved via local element in ${local.parentKind}${local.parentLocalName}, type ${type.localName})`
460
+
: element
461
+
? `Children of ${element.localName} (via type ${type.localName})`
462
+
: `Children of ${type.localName}`;
422
463
lines.push(`## ${heading}`);
423
464
lines.push("");
465
+
if(local){
466
+
lines.push(
467
+
`_\`${local.localName}\` has no top-level qname; it's a local element declared in ${local.parentKind} \`${local.parentLocalName}\`. Children come from its declared type \`${type.localName}\`._`,
468
+
);
469
+
lines.push("");
470
+
}
424
471
lines.push(`- profile: ${profile}`);
425
472
lines.push(`- type vocabulary: ${type.vocabularyId}`);
426
473
lines.push(`- type namespace: ${type.namespaceUri}`);
@@ -454,13 +501,23 @@ function formatAttributesReport(
454
501
type: SymbolHit,
455
502
attrs: AttrEntry[],
456
503
profile: string,
504
+
opts: {resolvedFromLocal?: LocalElementHit}={},
457
505
): string{
458
506
constlines: string[]=[];
459
-
constheading=element
460
-
? `Attributes of ${element.localName} (via type ${type.localName})`
461
-
: `Attributes of ${type.localName}`;
507
+
constlocal=opts.resolvedFromLocal;
508
+
constheading=local
509
+
? `Attributes of ${local.localName} (resolved via local element in ${local.parentKind}${local.parentLocalName}, type ${type.localName})`
510
+
: element
511
+
? `Attributes of ${element.localName} (via type ${type.localName})`
512
+
: `Attributes of ${type.localName}`;
462
513
lines.push(`## ${heading}`);
463
514
lines.push("");
515
+
if(local){
516
+
lines.push(
517
+
`_\`${local.localName}\` has no top-level qname; it's a local element declared in ${local.parentKind} \`${local.parentLocalName}\`. Attributes come from its declared type \`${type.localName}\`._`,
518
+
);
519
+
lines.push("");
520
+
}
464
521
lines.push(`- profile: ${profile}`);
465
522
lines.push(`- type vocabulary: ${type.vocabularyId}`);
"Resolve the parent owner (e.g. `ooxml_attributes` on the group/complexType) or pass the desired type directly.",
787
+
);
788
+
returnlines.join("\n");
789
+
}
790
+
791
+
functionformatLocalElementReport(
792
+
qname: {namespace: string;localName: string},
793
+
first: LocalElementHit,
794
+
locals: LocalElementHit[],
795
+
profile: string,
796
+
): string{
797
+
// Invariant: callers only reach here via `resolveLocalElement` returning
798
+
// `single`, which means every entry in `locals` shares `first.typeRef`.
799
+
// The ambiguous case takes a different code path
800
+
// (formatLocalElementAmbiguous), so "also declared" here doesn't risk
801
+
// implying agreement that doesn't exist.
802
+
constlines: string[]=[];
803
+
lines.push(`## Local element: ${first.localName}`);
804
+
lines.push("");
805
+
lines.push(
806
+
`_\`${first.localName}\` has no top-level qname in this namespace. It's declared inline inside ${first.parentKind} \`${first.parentLocalName}\`. Call \`ooxml_attributes\` or \`ooxml_children\` with the same qname to follow its type._`,
0 commit comments