Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix/generate docs issues #32

Merged
merged 4 commits into from
May 26, 2022
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
14 changes: 7 additions & 7 deletions src/stub-gen/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ function generateDocProperty(name: string, p: IDocProperty, comments?: string[])
} else if (p.table) {
code += `${_LT(p.type)}[]`; // Lua table
} else if (p.nestedArray) {
// TODO: Implement
code += `vector|table<integer, vector|${_LT(p.type)}[]>`; // nestedArray
} else if (p.nestedTable) {
// TODO: Implement
code += `table<integer, vector|${_LT(p.type)}[]>`; // nestedTable
} else {
code += `${_LT(p.type)}`;
}
Expand Down Expand Up @@ -139,14 +139,14 @@ function generateDocParam(name: string, p: IDocParam) {
} else if (p.table) {
code += `${_LT(p.type)}[]`; // Lua table
} else if (p.nestedArray) {
// TODO: Implement
code += `vector|table<integer, vector|${_LT(p.type)}[]>`; // nestedArray
} else if (p.nestedTable) {
// TODO: Implement
code += `table<integer, vector|${_LT(p.type)}[]>`; // nestedTable
} else {
code += `${_LT(p.type)}`;
}

if (p.nullable) {
if (p.nullable || p.default) {
code += '|nil';
}
}
Expand Down Expand Up @@ -178,9 +178,9 @@ function generateDocReturn(returns: IDocType | IDocType[], comments?: string[])
} else if (r.table) {
code += `${_LT(r.type)}[]`; // Lua table
} else if (r.nestedArray) {
// TODO: Implement
code += `vector|table<integer, vector|${_LT(r.type)}[]>`; // nestedArray
} else if (r.nestedTable) {
// TODO: Implement
code += `table<integer, vector|${_LT(r.type)}[]>`; // nestedTable
} else {
code += `${_LT(r.type)}`;
}
Expand Down