Refactor class parsing completely
This commit is contained in:
@@ -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}}
|
||||
|
Reference in New Issue
Block a user