# @show\_code macro

**URL:** <https://discourse.julialang.org/t/show-code-macro/46050>\
**Category:** General Usage\
**Tags:** question\
**Created:** [September 4, 2020, 11:22am UTC](https://discourse.julialang.org/t/show-code-macro/46050 "2020-09-04T11:22:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Impressium](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/impressium/32/19575_2.png) [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Post date:** [September 4, 2020, 11:22am UTC](https://discourse.julialang.org/t/show-code-macro/46050/1 "2020-09-04T11:22:37Z")

</div>

Hey 🙂

Is there a `@show_code` yet?

e.g.:

```julia
julia> @show_code sqrt(1+1)
sqrt(1+1) in Main at REPL[10]:1

```

In file.jl

```julia
1:
2:@show_code sqrt(1+1)
3:

```

after running returns:  
`sqrt(1+1) in file.jl:2`

So I can do:  
In file.jl

```julia
1:
2:@time @show_code sqrt(1+1)
3:

```

after running returns:

```julia
 sqrt(1+1) in file.jl:2`
 0.000000 seconds

```

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [September 4, 2020, 11:27am UTC](https://discourse.julialang.org/t/show-code-macro/46050/2 "2020-09-04T11:27:05Z")

</div>

You can use `@code_string` from [`CodeTracking.jl`](https://github.com/timholy/CodeTracking.jl).

---

<div class="post-metadata">

**Author:** ![Impressium](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/impressium/32/19575_2.png) [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Post date:** [September 4, 2020, 11:50am UTC](https://discourse.julialang.org/t/show-code-macro/46050/3 "2020-09-04T11:50:45Z")

</div>

Oh that’s also cool, but goes one level to deep for me. I what something more like the written code + line number + File

In file.jl

```julia
1:
2:@show_code sqrt(1+1)
3:

```

after running returns:  
`sqrt(1+1) in file.jl:2`
