# Why is there a difference in tab completion for names made available through using vs import in the REPL?

**URL:** <https://discourse.julialang.org/t/why-is-there-a-difference-in-tab-completion-for-names-made-available-through-using-vs-import-in-the-repl/62888>\
**Category:** New to Julia\
**Tags:** question, repl\
**Created:** [June 14, 2021, 12:48pm UTC](https://discourse.julialang.org/t/why-is-there-a-difference-in-tab-completion-for-names-made-available-through-using-vs-import-in-the-repl/62888 "2021-06-14T12:48:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jishnub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jishnub/32/33620_2.png) [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Post date:** [June 14, 2021, 12:48pm UTC](https://discourse.julialang.org/t/why-is-there-a-difference-in-tab-completion-for-names-made-available-through-using-vs-import-in-the-repl/62888/1 "2021-06-14T12:48:38Z")

</div>

```julia
julia> using Base: IdentityUnitRange

julia> Iden[TAB] # nothing happens here

julia> import Base: IdentityUnitRange

julia> Iden[TAB] -> IdentityUnitRange # tab completion works now

```

Why does tab completion not work if the type is made available through `using`? Often I choose `using` instead of `import` to avoid accidentally extending a function, however the absence of tab-completion makes using this form harder.

---

<div class="post-metadata">

**Author:** ![jlapeyre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlapeyre/32/4514_2.png) [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)\
**Post date:** [March 31, 2023, 7:48pm UTC](https://discourse.julialang.org/t/why-is-there-a-difference-in-tab-completion-for-names-made-available-through-using-vs-import-in-the-repl/62888/2 "2023-03-31T19:48:59Z")

</div>

Yes. It would be nice to know the rhyme and reason.  
And this is curious:

```julia
julia> import Base.Id[TAB .. TAB] # nothing happens
julia> import Base: Id[TAB] # nothing happens
julia> using ... # same, nothing
julia> Base.Id[TAB] # Bingo! I get completion, so go ahead and complete,
                                # then position cursor at front and type `import`
julia> import Base.IdentityUnitRange

```

I just found (or likely rediscovered) that `import` allows completion but `using` does not. This has been really annoying when doing `using APackage: somesymbol` and then not being able to complete. I had resorted to this:

```julia
macro rusing(ex)
    sym = ex.args[2].value
    expr = :(const $sym = $ex)
    :($(esc(expr)))
end

```

and

```julia
@rusing Base.IdentityUnitRange

```

But this seems no better than `import` and it also does not prevent extending what you import.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [March 31, 2023, 10:22pm UTC](https://discourse.julialang.org/t/why-is-there-a-difference-in-tab-completion-for-names-made-available-through-using-vs-import-in-the-repl/62888/3 "2023-03-31T22:22:48Z")

</div>

> [@jlapeyre](#):
>
> I just found (or likely rediscovered) that `import` allows completion but `using` does not. This has been really annoying when doing `using APackage: somesymbol` and then not being able to complete.

If we do `using Plots`, then `heat<TAB>` will autocomplete to `heatmap`.

---

<div class="post-metadata">

**Author:** ![jlapeyre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlapeyre/32/4514_2.png) [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)\
**Post date:** [April 1, 2023, 12:13am UTC](https://discourse.julialang.org/t/why-is-there-a-difference-in-tab-completion-for-names-made-available-through-using-vs-import-in-the-repl/62888/4 "2023-04-01T00:13:15Z")

</div>

If the symbol is not `export`ed then tab completion does not work after `using`.

```julia
module ModA
export asym
asym = 1
end

module ModB
bsym = 1
end

```

```julia
julia> using ModA: asym # now completion will work
julia> using ModB: bsym # tab completion will not work for bsym
julia> import ModB: bsym # Now tab completion *will* work

```
