Tab completion for sub-modules names

123 views
Skip to first unread message

Miguel Goncalves

unread,
Aug 24, 2016, 7:49:50 PM8/24/16
to julia-users
In the Julia REPL if I have a super-module Food which loads in a sub-module Fruit,

module Food

using Fruit

include
("nutrition.jl")
export carbohydrate
export fat
export protein

end

then pressing tab after typing,

Food.

I get the list,

carbohydrate    fat    protein

But the sub-module Fruit does not show up for tab completion. However, after manually typing,

Food.Fruit.

I do have tab completion for everything which is exported by the Fruit sub-module.

Could this behavior be changed to support tab completion for sub-modules names? This will facilitate working with nested modules.

Tony Kelman

unread,
Aug 25, 2016, 2:50:05 AM8/25/16
to julia-users
What version of Julia are you on? My memory might be hazy but there's a chance this has been implemented recently on master? If not, then this does sound like it would be useful to implement.

Yichao Yu

unread,
Aug 25, 2016, 3:03:40 AM8/25/16
to Julia Users
On Thu, Aug 25, 2016 at 2:50 PM, Tony Kelman <to...@kelman.net> wrote:
What version of Julia are you on? My memory might be hazy but there's a chance this has been implemented recently on master? If not, then this does sound like it would be useful to implement.

I believe imported and unexported symbols are intentionally not included in the auto completion.

Stefan Karpinski

unread,
Aug 25, 2016, 10:14:10 AM8/25/16
to Julia Users
That's right. This has nothing to do with Fruit being a submodule and everything about it being a binding in Food that's not exported and therefore not part of Food's externally facing interface.

Miguel Goncalves

unread,
Aug 29, 2016, 8:47:12 PM8/29/16
to julia-users
I see, but how is it that I can still access variables exported by Fruit, even though, Fruit is not exported by Food? E.g.:

Food.Fru[TAB]

does not work but

Food.Fruit.[TAB]

does work.

Miguel Goncalves

unread,
Aug 29, 2016, 8:48:54 PM8/29/16
to julia-users
My Julia is 18 days old:

Version 0.6.0-dev.166 (2016-08-11 16:27 UTC)
Commit f964e10 (18 days old master)
x86_64-pc-linux-gnu
Reply all
Reply to author
Forward
0 new messages