AutomaticDocstrings does not generate output

Hello,

I’m trying to use the AutomaticDocstring package, but I cannot make it work.

When I evaluate to following the example from the docs in Juno:

using AutomaticDocstrings

@autodoc
function f(x::A, b=5; c=LinRange(1,2,10)) where A
    5
end

Instead of getting the docstring, I get this error message next to the @autodoc macro:

I did not find a function or struct definition. Place `@autodoc` right above a function or struct definition. Line number: 3
error(::String) at error.jl:33
get_function_definition(::String, ::Int64) at AutomaticDocstrings.jl:60
generate_docstring(::String, ::Int64) at AutomaticDocstrings.jl:50
autodoc(::String, ::Int64) at AutomaticDocstrings.jl:26
top-level scope at AutomaticDocstrings.jl:20

I’m using Juno 0.7.0

Here is the output of versioninfo()

julia> versioninfo()
Julia Version 1.1.0
Commit 80516ca202 (2019-01-21 21:24 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Xeon(R) CPU E3-1225 v3 @ 3.20GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, haswell)
Environment:
  JULIA_EDITOR = atom  -a
  JULIA_NUM_THREADS = 4

I’m on ubuntu 18

Any help would be welcome.
Best,
Olivier

Works fine for me, provided you evaluate

@autodoc
function f(x::A, b=5; c=LinRange(1,2,10)) where A
    5
end

at once and not the macro first and the function definition afterwards.

What do you mean by evaluating at once?
Selecting macro and function body and then evaluate?
I tried that, but it still gives the same error.

I only managed to get the docstring once, the rest of the time it gives this error.
Thanks again

ok, sorry.
I found the issue.

The file is changed but the modification does not appear necessarily in atom. When I open in another text editor it does appear.

Sorry for the noise and thanks again for you help.
Olivier

1 Like