Skip to content

Commit

Permalink
Merge pull request #9 from NegativeNameNGT/patch-1
Browse files Browse the repository at this point in the history
[change] Define `static_properties` after class table creation
  • Loading branch information
Derpius authored Apr 22, 2024
2 parents d8d53f9 + 75bf0ce commit 7de5e77
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ function ${cls.name}${
});
}

const staticFields = cls.static_properties?.map(field => `${field.name} = ${field.value}`).join(", ") ?? "";
const staticFields = cls.static_properties?.length ? `\n${cls.static_properties.map(field => `${cls.name}.${field.name} = ${field.value}`).join("\n")}` : "";

let operators = "";
if (cls.operators !== undefined) {
Expand All @@ -377,7 +377,7 @@ function ${cls.name}${
---
---${generateDocstring(cls)}
---@class ${cls.name}${inheritance}${fields}${operators}${constructors}
${cls.name} = {${staticFields}}${staticFunctions}${functions}${events}`;
${cls.name} = {}${staticFields}${staticFunctions}${functions}${events}`;
}

function generateEnum(name: string, values: DocEnumValue[]): string {
Expand Down

0 comments on commit 7de5e77

Please sign in to comment.