# What's correct way to write a module separate in multiple files to maximum ide auto complete support?

**URL:** https://discourse.julialang.org/t/whats-correct-way-to-write-a-module-separate-in-multiple-files-to-maximum-ide-auto-complete-support/15108
**Category:** General Usage
**Tags:** question
**Created:** [September 18, 2018, 5:36am UTC](https://discourse.julialang.org/t/whats-correct-way-to-write-a-module-separate-in-multiple-files-to-maximum-ide-auto-complete-support/15108 "2018-09-18T05:36:10Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![xiang0x48](https://avatars.discourse-cdn.com/v4/letter/x/53a042/32.png) [@xiang0x48](https://discourse.julialang.org/u/xiang0x48)
#### Post date: [September 18, 2018, 5:36am UTC](https://discourse.julialang.org/t/whats-correct-way-to-write-a-module-separate-in-multiple-files-to-maximum-ide-auto-complete-support/15108/1 "2018-09-18T05:36:10Z")

</div>

As said in doc [Modules and files](https://docs.julialang.org/en/v1/manual/modules/#Modules-and-files-1), modules can be separated into multiple files like

```julia
module Foo
include("file1.jl")
include("file2.jl")
end

```

However there would be one problem, suppose we are developing a module, and would like to separate implementations into `data.jl`, `func0.jl` and `func1.jl`, and `data.jl` is for definition of structures, `func0.jl` and `func1.jl` are some function definitions, using context of `data.jl` for multidispatch.  
Then it seems the module definition would be

```julia
module MyModule
include("data.jl")
include("func0.jl")
include("func1.jl")
end

```

It works, but the problem is when writing `func0.jl` and `func1.jl`, we do not have definitions of structures, and auto complete/hints may fail.

If we are using python, we may have file structure

```julia
__init__.py
data.py
func0.py
func1.py

```

and simply use `from .data import SomeDataClass` in `func0.py`, I’m wondering what’s the correct julia way of dealing with this.

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [September 18, 2018, 6:37am UTC](https://discourse.julialang.org/t/whats-correct-way-to-write-a-module-separate-in-multiple-files-to-maximum-ide-auto-complete-support/15108/2 "2018-09-18T06:37:19Z")

</div>

> [@xiang0x48](#):
>
> auto complete/hints may fail.

Which IDE are you using?

---

<div class="post-metadata">

### Author: ![xiang0x48](https://avatars.discourse-cdn.com/v4/letter/x/53a042/32.png) [@xiang0x48](https://discourse.julialang.org/u/xiang0x48)
#### Post date: [September 19, 2018, 6:43am UTC](https://discourse.julialang.org/t/whats-correct-way-to-write-a-module-separate-in-multiple-files-to-maximum-ide-auto-complete-support/15108/3 "2018-09-19T06:43:08Z")

</div>

Thanks for your reply.

I’m using VS Code, with Julia 1.0.

Although there might be problem caused by extension problems to Julia 1.0.  
Currently VS Code have a minimal support for auto complete if all code were in one file.  
And I’m wondering if I do not put any hint in one file(no include/import/using at all), how can IDE/plugin/extension known where to find definitions?
