# Julia vscode stop working when there are many source file and include statements

**URL:** https://discourse.julialang.org/t/julia-vscode-stop-working-when-there-are-many-source-file-and-include-statements/36724
**Category:** VS Code
**Created:** [March 30, 2020, 9:06am UTC](https://discourse.julialang.org/t/julia-vscode-stop-working-when-there-are-many-source-file-and-include-statements/36724 "2020-03-30T09:06:57Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Patrick\_Chow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/patrick_chow/32/10550_2.png) [@Patrick\_Chow](https://discourse.julialang.org/u/Patrick_Chow)
#### Post date: [March 30, 2020, 9:06am UTC](https://discourse.julialang.org/t/julia-vscode-stop-working-when-there-are-many-source-file-and-include-statements/36724/1 "2020-03-30T09:06:57Z")

</div>

Hi,

I am using julia 1.4.0 and julia vscode 0.15.18. Everything is working great when I have only 1 - 2 files in my project. When there are more files, say 6-7 and I use “include” in those file. It appear that julia vscode simply stop working. I can still see the request and cancel request in trace output but the mouse hover will simply stuck at “Loading…”

Is that possible there are some buffer size limit somewhere in the language server such that if many include statement is used there will be some sort of buffer overflow? Is there any way to prevent a file from included more than once?

Thanks

Pat

---

<div class="post-metadata">

### Author: ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)
#### Post date: [March 30, 2020, 2:10pm UTC](https://discourse.julialang.org/t/julia-vscode-stop-working-when-there-are-many-source-file-and-include-statements/36724/2 "2020-03-30T14:10:36Z")

</div>

Is it possible that you have a circular dependency in the `include`s?

---

<div class="post-metadata">

### Author: ![Patrick\_Chow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/patrick_chow/32/10550_2.png) [@Patrick\_Chow](https://discourse.julialang.org/u/Patrick_Chow)
#### Post date: [March 30, 2020, 2:21pm UTC](https://discourse.julialang.org/t/julia-vscode-stop-working-when-there-are-many-source-file-and-include-statements/36724/3 "2020-03-30T14:21:50Z")

</div>

I thought about this, checked manually but didn’t find any.

should I use module … end to enclose all “include” statement, such that they will be run only once.

Sorry I am more of a C++ guy so dunno how it is dealt with not using #pragm once…

---

<div class="post-metadata">

### Author: ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)
#### Post date: [March 30, 2020, 2:25pm UTC](https://discourse.julialang.org/t/julia-vscode-stop-working-when-there-are-many-source-file-and-include-statements/36724/4 "2020-03-30T14:25:50Z")

</div>

I’d say post the structure that you have here. Perhaps we’d be able to help.

I use includes both ways: as one module per file ( file starts with `module` and ends with `end`), and also by including multiple files in a single module (included files do not define modules themselves).

---

<div class="post-metadata">

### Author: ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)
#### Post date: [March 30, 2020, 5:17pm UTC](https://discourse.julialang.org/t/julia-vscode-stop-working-when-there-are-many-source-file-and-include-statements/36724/5 "2020-03-30T17:17:01Z")

</div>

@Patrick_Chow could you actually open an issue with the details? This clearly seems a bug, so I think it is more a TODO for Zac and me than trying to find a workaround 🙂

---

<div class="post-metadata">

### Author: ![Patrick\_Chow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/patrick_chow/32/10550_2.png) [@Patrick\_Chow](https://discourse.julialang.org/u/Patrick_Chow)
#### Post date: [March 31, 2020, 1:27am UTC](https://discourse.julialang.org/t/julia-vscode-stop-working-when-there-are-many-source-file-and-include-statements/36724/6 "2020-03-31T01:27:46Z")

</div>

Sure, let me try to wrap up an example showing the example, tar gz the code and create an issue in github

---

<div class="post-metadata">

### Author: ![JosephPollacco](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/josephpollacco/32/51404_2.png) [@JosephPollacco](https://discourse.julialang.org/u/JosephPollacco)
#### Post date: [March 31, 2020, 5:04am UTC](https://discourse.julialang.org/t/julia-vscode-stop-working-when-there-are-many-source-file-and-include-statements/36724/7 "2020-03-31T05:04:13Z")

</div>

Hi David,

I believe that this mentioned issue is a similar issue I am facing  
[julia-language-server-server-crashed](https://discourse.julialang.org/t/vscode-linter-no-longer-working-the-julia-language-server-server-crashed/35904)

Thanks,  
Joseph

---

<div class="post-metadata">

### Author: ![Patrick\_Chow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/patrick_chow/32/10550_2.png) [@Patrick\_Chow](https://discourse.julialang.org/u/Patrick_Chow)
#### Post date: [March 31, 2020, 5:44am UTC](https://discourse.julialang.org/t/julia-vscode-stop-working-when-there-are-many-source-file-and-include-statements/36724/8 "2020-03-31T05:44:46Z")

</div>

Hi David,

So after investigation I found that if I have included any file more than once, the language server will just stuck (but there is no cyclic include there). I have now change to include all the file in my main file only, and everything just works.

Before (stuck)

```julia
Main.jl
include("File1.jl")
include("File2.jl")

File1.jl
include("File2.jl")

File2.jl
...

```

Now (not stuck)

```julia
Main.jl
include("File1.jl")
include("File2.jl")

File1.jl
...

File2.jl
...

```

---

<div class="post-metadata">

### Author: ![Patrick\_Chow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/patrick_chow/32/10550_2.png) [@Patrick\_Chow](https://discourse.julialang.org/u/Patrick_Chow)
#### Post date: [March 31, 2020, 12:50pm UTC](https://discourse.julialang.org/t/julia-vscode-stop-working-when-there-are-many-source-file-and-include-statements/36724/9 "2020-03-31T12:50:06Z")

</div>

Oh btw, I really wanna say thank you to David and Zac, you guys helped the Julia community, by providing an extension to one of the best editor…

---

<div class="post-metadata">

### Author: ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)
#### Post date: [April 7, 2020, 9:41pm UTC](https://discourse.julialang.org/t/julia-vscode-stop-working-when-there-are-many-source-file-and-include-statements/36724/10 "2020-04-07T21:41:58Z")

</div>

I can’t reproduce this… I literally have a folder with only the files `Main.jl`, `File1.jl` and `File2.jl` in it and the content you show. Everything seems to work fine if I open that folder…

---

<div class="post-metadata">

### Author: ![Patrick\_Chow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/patrick_chow/32/10550_2.png) [@Patrick\_Chow](https://discourse.julialang.org/u/Patrick_Chow)
#### Post date: [April 13, 2020, 2:04pm UTC](https://discourse.julialang.org/t/julia-vscode-stop-working-when-there-are-many-source-file-and-include-statements/36724/11 "2020-04-13T14:04:17Z")

</div>

I can’t reproduce this neither with the mock up file… When I use my code I have the problem… But now I have changed them all and everything seems fine…

How about if I run into the problem again I send you my code?

Thanks

---

<div class="post-metadata">

### Author: ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)
#### Post date: [April 13, 2020, 2:19pm UTC](https://discourse.julialang.org/t/julia-vscode-stop-working-when-there-are-many-source-file-and-include-statements/36724/12 "2020-04-13T14:19:24Z")

</div>

I have a repo code set now, just haven’t found the bug yet. Most likely all of these are due to the same error, so I think let me try to fix this based on the repo case I have right now, and if folks then still have problems, sharing code with me would be great.
