Skip to content

Commit 8d4f992

Browse files
committed
Parse class defaults
1 parent 9fe69a4 commit 8d4f992

File tree

5 files changed

+882
-2
lines changed

5 files changed

+882
-2
lines changed

src/components/schema/SchemaClass.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,14 @@ function InheritedFieldView({ field }: { field: api.SchemaField }) {
299299
);
300300
}
301301

302+
const DefaultValueSpan = styled.span`
303+
color: var(--text-dim);
304+
opacity: 0.7;
305+
font-size: 13px;
306+
white-space: pre-wrap;
307+
word-break: break-all;
308+
`;
309+
302310
const BitRange = styled.span`
303311
font-family: var(--font-mono);
304312
font-size: 13px;
@@ -346,6 +354,9 @@ function SchemaFieldView({
346354
{field.name}
347355
</AnchorName>
348356
: <SchemaTypeView type={field.type} />
357+
{field.defaultValue != null && (
358+
<DefaultValueSpan> = {field.defaultValue}</DefaultValueSpan>
359+
)}
349360
{bitfield && (
350361
<BitRange>
351362
bit{bitfield.bitCount !== 1 ? "s" : ""} {bitfield.bitOffset}

0 commit comments

Comments
 (0)