# Listing all names available in a module

**URL:** <https://discourse.julialang.org/t/listing-all-names-available-in-a-module/32601>\
**Category:** General Usage\
**Tags:** question\
**Created:** [December 23, 2019, 2:42am UTC](https://discourse.julialang.org/t/listing-all-names-available-in-a-module/32601 "2019-12-23T02:42:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gcv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gcv/32/11086_2.png) [@gcv](https://discourse.julialang.org/u/gcv)\
**Post date:** [December 23, 2019, 2:42am UTC](https://discourse.julialang.org/t/listing-all-names-available-in-a-module/32601/1 "2019-12-23T02:42:39Z")

</div>

Is there a way to figure out which names are available in the context of a given module? I want to list all names defined in the module, _and_ imported into the module’s namespace with `using`, _and_ all modules referenced with `import`. I know about `propertynames(module, true)`, but that only solves the first part of the problem.

(Context: [Emacs development environment for Julia](https://discourse.julialang.org/t/resolving-a-module-by-its-name/30569/9). This is necessary to implement autocompletion.)

---

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [December 23, 2019, 4:03am UTC](https://discourse.julialang.org/t/listing-all-names-available-in-a-module/32601/2 "2019-12-23T04:03:25Z")

</div>

```julia
julia> using DSP

help?> names
search: names fieldnames propertynames nameof NamedTuple dirname tempname fullname basename fieldname gethostname backend_name

  names(x::Module; all::Bool = false, imported::Bool = false)

  Get an array of the names exported by a Module, excluding deprecated names. If all is true, then the list also includes non-exported names defined in the module, deprecated names, and compiler-generated
  names. If imported is true, then names explicitly imported from other modules are also included.

  As a special case, all names defined in Main are considered "exported", since it is not idiomatic to explicitly export names from Main.

julia> names(DSP, all=true, imported=true)
166-element Array{Symbol,1}:
 Symbol("##meta#112")           
 Symbol("##xcorr#11")           
 Symbol("#1#4")                 
 Symbol("#2#5")                 
 Symbol("#3#6")                 
 Symbol("#7#8")                 
...

```

---

<div class="post-metadata">

**Author:** ![gcv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gcv/32/11086_2.png) [@gcv](https://discourse.julialang.org/u/gcv)\
**Post date:** [December 25, 2019, 11:35pm UTC](https://discourse.julialang.org/t/listing-all-names-available-in-a-module/32601/3 "2019-12-25T23:35:00Z")

</div>

Thanks, that works. I missed `names` while looking too hard at `propertynames`.

---

<div class="post-metadata">

**Author:** ![gcv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gcv/32/11086_2.png) [@gcv](https://discourse.julialang.org/u/gcv)\
**Post date:** [January 4, 2020, 7:01pm UTC](https://discourse.julialang.org/t/listing-all-names-available-in-a-module/32601/4 "2020-01-04T19:01:31Z")

</div>

Is there a way to make this work for names brought in implicitly with `using`?
