Refactor class parsing completely

This commit is contained in:
2024-09-12 16:18:55 +02:00
parent 3994b5aa74
commit 867c31b6d3
3 changed files with 45 additions and 10 deletions

View File

@@ -1,7 +1,7 @@
---@diagnostic disable: missing-return, lowercase-global
---@class {{.ClassName}}
{{range .Fields -}}
---@field {{.Name}} {{.Type}} {{.Comment}}
---@field {{.Name}} {{.Type}}{{if ne .Comment ""}} {{.Comment}}{{end}}
{{end -}}
{{.ClassName}} = {
{{$n := len .Methods -}}
@@ -9,7 +9,7 @@
{{range $index, $method := .Methods -}}
---@param self {{$.ClassName}}
{{range $param := $method.Params -}}
---@param {{.Name}} {{.Type}} {{.Comment}}
---@param {{.Name}} {{.Type}}{{if ne .Comment ""}} {{.Comment}}{{end}}
{{end -}}
{{range $ret := $method.Returns -}}
---@return {{.Type}} {{if ne .Comment ""}}#{{.Comment}}{{end}}