# AutomaticDocstrings does not generate output

**URL:** <https://discourse.julialang.org/t/automaticdocstrings-does-not-generate-output/28158>\
**Category:** General Usage\
**Created:** [August 29, 2019, 9:13am UTC](https://discourse.julialang.org/t/automaticdocstrings-does-not-generate-output/28158 "2019-08-29T09:13:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Olivier\_Merchiers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/olivier_merchiers/32/4073_2.png) [@Olivier\_Merchiers](https://discourse.julialang.org/u/Olivier_Merchiers)\
**Post date:** [August 29, 2019, 9:13am UTC](https://discourse.julialang.org/t/automaticdocstrings-does-not-generate-output/28158/1 "2019-08-29T09:13:18Z")

</div>

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:

```julia
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:

```julia
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
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

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [August 29, 2019, 9:32am UTC](https://discourse.julialang.org/t/automaticdocstrings-does-not-generate-output/28158/2 "2019-08-29T09:32:33Z")

</div>

Works fine for me, provided you evaluate

```julia
@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.

---

<div class="post-metadata">

**Author:** ![Olivier\_Merchiers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/olivier_merchiers/32/4073_2.png) [@Olivier\_Merchiers](https://discourse.julialang.org/u/Olivier_Merchiers)\
**Post date:** [August 29, 2019, 9:45am UTC](https://discourse.julialang.org/t/automaticdocstrings-does-not-generate-output/28158/3 "2019-08-29T09:45:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Olivier\_Merchiers](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/olivier_merchiers/32/4073_2.png) [@Olivier\_Merchiers](https://discourse.julialang.org/u/Olivier_Merchiers)\
**Post date:** [August 29, 2019, 9:49am UTC](https://discourse.julialang.org/t/automaticdocstrings-does-not-generate-output/28158/4 "2019-08-29T09:49:07Z")

</div>

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
