You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TEXT("add", NOSPLIT, "func(x, y uint64) uint64")
Doc("add uint64 x and y\nreturns uint64 sum of x and y")
Produces invalid syntax:
// add uint64 x and yreturnsuint64sumofxandyfuncadd(xuint64, yuint64) uint64
Attempt B:
Using Doc multiple times...
TEXT("add", NOSPLIT, "func(x, y uint64) uint64")
Doc("add uint64 x and y")
Doc("returns uint64 sum of x and y")
... doesn't work as expected:
// returns uint64 sum of x and yfuncadd(xuint64, yuint64) uint64
Attempt C:
Just writing a really long docstring...
TEXT("add", NOSPLIT, "func(x, y uint64) uint64")
Doc("add uint64 x and y returns uint64 sum of x and y which is super useful when you just want to add two numbers with a whole bunch of call overhead as an excuse to use Avo")
...doesn't result in a sensibly wrapped output:
// add uint64 x and y returns uint64 sum of x and y which is super useful when you just want to add two numbers with a whole bunch of call overhead as an excuse to use Avofuncadd(xuint64, yuint64) uint64
Suggestion:
Cases A and B are arguably bugs. Case C would be nice to fix, but is probably not needed if A and B are fixed.
The text was updated successfully, but these errors were encountered:
I hasten to add: yes, I know that Doc() is variadic, and using it that way is the "correct" way to address the use cases above. But attempts A-C above are not unreasonable things for a user to try, and they all fail in their own way to generate the predicted output.
Hmmm, yes agree A and B are not ideal. I could change Doc to append. I find it hard to believe anyone would be relying on the existing overwrite behavior.
Not sure about auto-wrapping, it's not always what you'd want. Maybe a different function like WrapDoc? Is there a better name?
Attempt A:
For example:
Produces invalid syntax:
Attempt B:
Using
Doc
multiple times...... doesn't work as expected:
Attempt C:
Just writing a really long docstring...
...doesn't result in a sensibly wrapped output:
Suggestion:
Cases A and B are arguably bugs. Case C would be nice to fix, but is probably not needed if A and B are fixed.
The text was updated successfully, but these errors were encountered: