Skip to content

Commit 467c4c4

Browse files
authored
fix(documentation/inlay-hints): fix size calculation (#377)
1 parent fba0696 commit 467c4c4

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

server/src/types/BaseTy.ts

+9-4
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,12 @@ export class FieldsOwnerTy<Anchor extends FieldsOwner> extends BaseTy<Anchor> {
9797
res = mergeSizes(res, size)
9898
})
9999

100-
return res
100+
const headerSize = this.anchor?.node.type === "message" ? 32 : 0
101+
102+
return mergeSizes(res, {
103+
fixed: headerSize,
104+
floating: 0,
105+
})
101106
}
102107
}
103108

@@ -135,10 +140,10 @@ export class PrimitiveTy extends BaseTy<Primitive> {
135140
this.tlb === "varuint16" ||
136141
this.tlb === "varint16"
137142
) {
138-
return {fixed: 4, floating: 124}
143+
return {fixed: 4, floating: 120}
139144
}
140145
if (this.tlb === "varuint32" || this.tlb === "varint32") {
141-
return {fixed: 5, floating: 253}
146+
return {fixed: 5, floating: 248}
142147
}
143148

144149
const trimmed = trimPrefix(trimPrefix(this.tlb, "uint"), "int")
@@ -154,7 +159,7 @@ export class PrimitiveTy extends BaseTy<Primitive> {
154159
return {fixed: 1, floating: 0}
155160
}
156161
case "Address": {
157-
return {fixed: 257, floating: 0}
162+
return {fixed: 267, floating: 0}
158163
}
159164
case "Cell":
160165
case "Slice":

0 commit comments

Comments
 (0)