Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(documentation/inlay-hints): fix size calculation #377

Merged
merged 1 commit into from
Feb 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions server/src/types/BaseTy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,12 @@ export class FieldsOwnerTy<Anchor extends FieldsOwner> extends BaseTy<Anchor> {
res = mergeSizes(res, size)
})

return res
const headerSize = this.anchor?.node.type === "message" ? 32 : 0

return mergeSizes(res, {
fixed: headerSize,
floating: 0,
})
}
}

Expand Down Expand Up @@ -135,10 +140,10 @@ export class PrimitiveTy extends BaseTy<Primitive> {
this.tlb === "varuint16" ||
this.tlb === "varint16"
) {
return {fixed: 4, floating: 124}
return {fixed: 4, floating: 120}
}
if (this.tlb === "varuint32" || this.tlb === "varint32") {
return {fixed: 5, floating: 253}
return {fixed: 5, floating: 248}
}

const trimmed = trimPrefix(trimPrefix(this.tlb, "uint"), "int")
Expand All @@ -154,7 +159,7 @@ export class PrimitiveTy extends BaseTy<Primitive> {
return {fixed: 1, floating: 0}
}
case "Address": {
return {fixed: 257, floating: 0}
return {fixed: 267, floating: 0}
}
case "Cell":
case "Slice":
Expand Down