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

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

Is it possible that you have a circular dependency in the includes?

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…

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).

@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 :slight_smile:

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

Hi David,

I believe that this mentioned issue is a similar issue I am facing
julia-language-server-server-crashed

Thanks,
Joseph

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)

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

File1.jl
include("File2.jl")

File2.jl
...

Now (not stuck)

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

File1.jl
...

File2.jl
...

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…

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…

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

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.