v.Doc() function from Cuelang doesn't retrieve inner comments. When it happens, we need to cast the cue.Value to ast.File and iterate it (We did something similar in thema) to retrieve the missing ones: code
Another changes in the PR:
Merged commentsFor with commentsForGroup and use only commentsFor.
Moved comments related of ts class to its own one and created its own Comment struct.
ObjectLit was putting commas at the end of each line, so the comma was after the comment instead after the value type. When the value comes from a KeyValueExpr, we put the semicolon after the value type: here and here.
v.Doc()
function from Cuelang doesn't retrieve inner comments. When it happens, we need to cast thecue.Value
toast.File
and iterate it (We did something similar in thema) to retrieve the missing ones: codeAnother changes in the PR:
commentsFor
withcommentsForGroup
and use onlycommentsFor
.ts
class to its own one and created its ownComment
struct.KeyValueExpr
, we put the semicolon after the value type: here and here.