not sure if this is related, but I sometimes use the following template when I need a way to fold regions of code in the IDE (VS code for me) in a long nim file (of course I could split and do imports, but sometimes it is quicker this way): template region(name, body: untyped) {.dirty.} = body Run
and I use it like this region(common): ... # code for common functionalities of the api region(featureA): ... # code for code related to featureA ... # other regions Run