# How to view source of import/using Package?

**URL:** <https://discourse.julialang.org/t/how-to-view-source-of-import-using-package/79893>\
**Category:** VS Code\
**Created:** [April 23, 2022, 2:07pm UTC](https://discourse.julialang.org/t/how-to-view-source-of-import-using-package/79893 "2022-04-23T14:07:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![guidorice](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/guidorice/32/32310_2.png) [@guidorice](https://discourse.julialang.org/u/guidorice)\
**Post date:** [April 23, 2022, 2:07pm UTC](https://discourse.julialang.org/t/how-to-view-source-of-import-using-package/79893/1 "2022-04-23T14:07:25Z")

</div>

When I have installed some packages, then I can view docstrings of imported/using packages, by hovering over an expression or variable.

However, Go to Definition (F12) does not work for imported or using Packages. This is something that seems standard in other VSCode language extensions. Could it be there something I’m missing in my config of VSCode?

Also viewing toplevel docstrings for a module not seem to work. (Wait does Julia even have toplevel doc strings)?

Best,

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [April 24, 2022, 5:26am UTC](https://discourse.julialang.org/t/how-to-view-source-of-import-using-package/79893/2 "2022-04-24T05:26:13Z")

</div>

I can’t answer the VSCode questions but regarding top level docstrings, if you mean a docstrings for a module itself Julia has them, but not all modules will have implemented one. You can try it with

```julia
"""
This is a docstring
"""
module MyModule
end

```

And see if you can view that docstring

---

<div class="post-metadata">

**Author:** ![guidorice](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/guidorice/32/32310_2.png) [@guidorice](https://discourse.julialang.org/u/guidorice)\
**Post date:** [April 24, 2022, 1:25pm UTC](https://discourse.julialang.org/t/how-to-view-source-of-import-using-package/79893/3 "2022-04-24T13:25:15Z")

</div>

Thanks @gustaphe for confirming that.

The gist of my question is: what is your workflow when you see import/using statements of new modules which you want to learn. What’s the fastest way to jump over to the source code of the imported model?

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [April 24, 2022, 3:19pm UTC](https://discourse.julialang.org/t/how-to-view-source-of-import-using-package/79893/4 "2022-04-24T15:19:29Z")

</div>

I like checking the GitHub repo in a browser (almost all packages are in GitHub, often as Package.jl). `@edit Module` should get you there too.

---

<div class="post-metadata">

**Author:** ![guidorice](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/guidorice/32/32310_2.png) [@guidorice](https://discourse.julialang.org/u/guidorice)\
**Post date:** [April 24, 2022, 11:22pm UTC](https://discourse.julialang.org/t/how-to-view-source-of-import-using-package/79893/5 "2022-04-24T23:22:54Z")

</div>

That’s a good tip about `edit`. This worked for me in the REPL:

```julia
julia> import Package
julia> edit(Package)

```

That opens `Package.jl` in the same VSCode window.  
It would be nice if the VSCode extension had a shortcut for doing the same?

---

<div class="post-metadata">

**Author:** ![guidorice](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/guidorice/32/32310_2.png) [@guidorice](https://discourse.julialang.org/u/guidorice)\
**Post date:** [April 25, 2022, 11:51pm UTC](https://discourse.julialang.org/t/how-to-view-source-of-import-using-package/79893/6 "2022-04-25T23:51:16Z")

</div>

I also opened an issue for an enhancement here [Go to Definition (F12) for import/using statements · Issue #2860 · julia-vscode/julia-vscode · GitHub](https://github.com/julia-vscode/julia-vscode/issues/2860)
