# Juno autocompletion doesn't work

**URL:** <https://discourse.julialang.org/t/juno-autocompletion-doesnt-work/38619>\
**Category:** Juno\
**Tags:** question\
**Created:** [May 2, 2020, 6:07pm UTC](https://discourse.julialang.org/t/juno-autocompletion-doesnt-work/38619 "2020-05-02T18:07:11Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![scimas](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@scimas](https://discourse.julialang.org/u/scimas)\
**Post date:** [May 2, 2020, 6:07pm UTC](https://discourse.julialang.org/t/juno-autocompletion-doesnt-work/38619/1 "2020-05-02T18:07:11Z")

</div>

I decided to give Juno a try and installed Atom and Juno, following the installation instructions on docs.junolab. Both are completely fresh installs, haven’t used either of them before on this PC.

I opened an existing project folder, but autocompletion just doesn’t work. Well, it does fill out the snippets listed in the language-julia package, and the latex completions but that’s it, no standard library functions / structs or other package completion.

I started a local julia procoess from the sidebar and then standard library autocompletion started working, but still nothing for other packages. Even the structs or functions defined in the same file don’t show up in autocompletion.

I found some threads talking about atom / package updates breaking Juno, but that isn’t the case for me since it’s a fresh install. The FAQ lists an issue with wrong precompile cache, I tried doing that too. Closed atom, opened a julia REPL, ran `using Atom`, exited julia, reopened atom. No change, still same issue.

Any help would be nice.

---

<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:** [May 2, 2020, 6:08pm UTC](https://discourse.julialang.org/t/juno-autocompletion-doesnt-work/38619/2 "2020-05-02T18:08:52Z")

</div>

Juno’s autocompletion only looks at the state of your current Julia process (except for local completions), so you need to load whatever packages you want completions for.

---

<div class="post-metadata">

**Author:** ![scimas](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@scimas](https://discourse.julialang.org/u/scimas)\
**Post date:** [May 2, 2020, 6:13pm UTC](https://discourse.julialang.org/t/juno-autocompletion-doesnt-work/38619/3 "2020-05-02T18:13:46Z")

</div>

I’m not sure what you mean by load a package? I do have `using xyz` written in my files whenever I use the packages.

And as I said, even the things written in the current file don’t get autocompleted.

```julia
struct Point
    x::Int
    y::Int
end

x = Poi

```

Nothing shows up to complete the `Point`. That’s the entirety of the file.

---

<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:** [May 2, 2020, 6:18pm UTC](https://discourse.julialang.org/t/juno-autocompletion-doesnt-work/38619/4 "2020-05-02T18:18:01Z")

</div>

Right, you need to execute the definition (with e.g. Ctrl-Enter):  
 ![grafik](https://global.discourse-cdn.com/julialang/original/3X/9/4/94f4d2af2aee8890863c536d3a8a0db5d5a67c87.png)

Same for modules or packages:  
 ![grafik](https://global.discourse-cdn.com/julialang/original/3X/e/3/e3897eb526b212039342a0534f4260268ab28563.png)

Local completions only work in actual local scopes (like functions):  
 ![grafik](https://global.discourse-cdn.com/julialang/original/3X/c/e/ce84fa4838242c141aac9827755f8a713dc54741.png)

---

<div class="post-metadata">

**Author:** ![scimas](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@scimas](https://discourse.julialang.org/u/scimas)\
**Post date:** [May 2, 2020, 6:36pm UTC](https://discourse.julialang.org/t/juno-autocompletion-doesnt-work/38619/5 "2020-05-02T18:36:01Z")

</div>

I see… So it’s loading everything into an actual julia session and getting the completions from it?

I understand it now, but it’s really counter-intuitive to me. Seems like it should be documented somewhere that you have to actually run the code to get autocompletions.

---

<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:** [May 2, 2020, 6:42pm UTC](https://discourse.julialang.org/t/juno-autocompletion-doesnt-work/38619/6 "2020-05-02T18:42:15Z")

</div>

> [@scimas](#):
>
> I see… So it’s loading everything into an actual julia session and getting the completions from it?

We’ll, _you’re_ loading code into the Julia session. But yes.  
We’re doing some static analysis for packages etc if you’re in the scope of the package.

> [@scimas](#):
>
> Seems like it should be documented somewhere that you have to actually run the code to get autocompletions.

That’s fair. Do you feel like opening a PR against our documentation [here](https://github.com/JunoLab/JunoDocs.jl/pulls)?

---

<div class="post-metadata">

**Author:** ![scimas](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@scimas](https://discourse.julialang.org/u/scimas)\
**Post date:** [May 2, 2020, 7:07pm UTC](https://discourse.julialang.org/t/juno-autocompletion-doesnt-work/38619/7 "2020-05-02T19:07:37Z")

</div>

> [@pfitzseb](#):
>
> We’re doing some static analysis for packages etc if you’re in the scope of the package.

I don’t get autocompletion even in a project folder (a project generated with `Pkg`, a Project.toml file and such) without loading the code into julia. I do get the static completion within functions as you said, but not within modules or packages.

> [@pfitzseb](#):
>
> Do you feel like opening a PR

Will do that, let me know under which section you’d like it to be.

Thanks for taking the time to help! Another question if you don’t mind: Is there a way to prioritize the snippets over the keyword completions? For example, `stru` completes to just the `struct` keyword, if I want to use the struct-name-field-end snippet, I have to arrow key down to it.

---

<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:** [May 2, 2020, 7:21pm UTC](https://discourse.julialang.org/t/juno-autocompletion-doesnt-work/38619/8 "2020-05-02T19:21:21Z")

</div>

> [@scimas](#):
>
> Will do that, let me know under which section you’d like it to be.

FAQ is probably fine, I think.

> [@scimas](#):
>
> For example, `stru` completes to just the `struct` keyword, if I want to use the struct-name-field-end snippet, I have to arrow key down to it.

You can play around with this setting:  
 ![grafik](https://global.discourse-cdn.com/julialang/original/3X/5/5/55a7cef32fbd9bf18b66d38b11e96b89b38de036.png)

---

<div class="post-metadata">

**Author:** ![scimas](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@scimas](https://discourse.julialang.org/u/scimas)\
**Post date:** [May 2, 2020, 7:34pm UTC](https://discourse.julialang.org/t/juno-autocompletion-doesnt-work/38619/9 "2020-05-02T19:34:32Z")

</div>

Thank you!
