JuliaDynamics / ResumableFunctions.jl

C# style generators a.k.a. semi-coroutines for Julia.
Other
158 stars 19 forks source link

Not able to document `@resumable` functions #45

Closed siddharthlal25 closed 1 year ago

siddharthlal25 commented 4 years ago

Doing this:

"""
    filenames(...)

docstring
"""
@resumable function filenames(...)
...
end

throws an error, error being:

cannot document the following expression:

#= /home/siddharth/.julia/dev/CCDReduction.jl/src/collection.jl:105 =# @resumable function filenames(df::DataFrame)
siddharthlal25 commented 4 years ago

The workaround was:

"""
    filenames(...)

docstring
"""
function filenames end

@resumable function filenames(...)
...
end

It would be nice to add a functionality that allows users to document directly above @resumable function.

hdavid16 commented 4 years ago

Yes, this would be nice

BenLauwens commented 3 years ago

I will look at this issue but I think the workaround is the easiest way to document resumable functions

detrin commented 3 years ago

I am using Documenter.jl and I have similar issue. The workaround is in my opinion only temporal solution. I suggest adding encapsulation of the function as follows

@resumable begin
"""
    filenames(...)

docstring
"""
function filenames(...)
...
end
end
Krastanov commented 1 year ago

To be fixed in #71 - for future reference, one simply needs to use Base.@__doc__ for situations like this.