# How to make vscode aware of user modules

**URL:** <https://discourse.julialang.org/t/how-to-make-vscode-aware-of-user-modules/22948>\
**Category:** VS Code\
**Tags:** question\
**Created:** [April 9, 2019, 6:02am UTC](https://discourse.julialang.org/t/how-to-make-vscode-aware-of-user-modules/22948 "2019-04-09T06:02:10Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [April 9, 2019, 6:02am UTC](https://discourse.julialang.org/t/how-to-make-vscode-aware-of-user-modules/22948/1 "2019-04-09T06:02:10Z")

</div>

The vscode plugin is taking the LOAD\_PATH of packages not into account, therefore symbols in my own code are not found. I am trying to fix that, but need some help.

What I tried so far:

1. tried to edit the file “~/.vscode/extensions/julialang.language-julia-0.11.5/scripts/languageserver/main.jl”. Adding:

```julia
 push!(LOAD_PATH, "PATH_TO_MY_MODULES")

```

had now effect.  
2. In the following file: [LanguageServer.jl/languageserverinstance.jl at master · julia-vscode/LanguageServer.jl · GitHub](https://github.com/JuliaEditorSupport/LanguageServer.jl/blob/master/src/languageserverinstance.jl) a language server instance is defined. It can instantiated with:

```julia
function LanguageServerInstance(pipe_in, pipe_out, debug_mode::Bool, env_path, depot_path, packages)

```

The last parameter is a dictionary. Is it correct that adding the name of a user module in this dictionary would help?  
And what is the difference between packages and modules? I have files, that define a module and are in local directory, but this are nof full packages with all the subdirectories and special files. Does that matter?

---

<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:** [April 9, 2019, 6:22am UTC](https://discourse.julialang.org/t/how-to-make-vscode-aware-of-user-modules/22948/2 "2019-04-09T06:22:14Z")

</div>

This may not help you directly, but I have not been using `LOAD_PATH` for anything since `v1.0`. I just

```julia
pkg> dev path/to/pkg

```

my “local” packages (ie the ones I work on, may or may not be public).

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [April 9, 2019, 6:30am UTC](https://discourse.julialang.org/t/how-to-make-vscode-aware-of-user-modules/22948/3 "2019-04-09T06:30:44Z")

</div>

As I said in another tread, this doesn’t work for me. I also do not HAVE my own packages, I only have my own modules. When I try your suggestion I get the following message in pkg\> status:

```julia
→ [14ec9285] src v0.0.0 [`~/00PythonSoftware/FastSim/src`]
┌ Warning: Some packages (indicated with a red arrow) are not downloaded, use `instantiate` to instantiate the current environment
└ @ Pkg.Display /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Display.jl:194

```

And using “intantiate” as suggested doesn’t make any difference, either.

---

<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:** [April 9, 2019, 6:50am UTC](https://discourse.julialang.org/t/how-to-make-vscode-aware-of-user-modules/22948/4 "2019-04-09T06:50:02Z")

</div>

> [@ufechner7](#):
>
> I also do not HAVE my own packages, I only have my own modules

Perhaps make them projects then? It is a very lightweight procedure, basically a `pkg> generate`. You get extras like being able to activate the environment, easier CI, etc.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [April 9, 2019, 10:04am UTC](https://discourse.julialang.org/t/how-to-make-vscode-aware-of-user-modules/22948/5 "2019-04-09T10:04:00Z")

</div>

I don’t want to have projects for modules that I need only in one program. That’s too much overhead. This are just scripts that are helpers for projects written in other languages in the first place, and they live in one folder. And I use modules to get the advantage of precompilation.

And I also asked something else:

> The last parameter is a dictionary. Is it correct that adding the name of a user module in this dictionary would help?

So please help me to fix this issue and not only to find a workaround.

---

<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 9, 2019, 2:39pm UTC](https://discourse.julialang.org/t/how-to-make-vscode-aware-of-user-modules/22948/6 "2019-04-09T14:39:29Z")

</div>

So here is the situation: the VS Code extension starts a new julia instance that is the language server. That code for that instance is `scripts/languageserver/min.jl`. We run that instance with a modified `JULIA_DEPOT_PATH` and a modified `LOAD_PATH`, and we shouldn’t change that. The reason they run with modified values there is to completely isolate the language server from anything that is going on in the users `.julia` folder, which has greatly helped us with setup and stability.

The language server process then starts _another_ process, which we call the symbol server process. This process runs with `JULIA_DEPOT_PATH` pointing to the users `.julia` folder. In that process we load the packages that the user uses and extract all the information we need for the language server.

So broadly speaking what we would need to do is make sure that the symbol server process runs with the `LOAD_PATH` that @ufechner7 customized. One question: how did you customize the `LOAD_PATH`? By setting the env var `JULIA_LOAD_PATH`? Or just in your julia code?

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [April 9, 2019, 5:26pm UTC](https://discourse.julialang.org/t/how-to-make-vscode-aware-of-user-modules/22948/7 "2019-04-09T17:26:47Z")

</div>

What is the difference between the JULIA\_DEPOT\_PATH and the LOAD\_PATH?

Currently I custimize the LOAD\_PATH in the following way:

```julia
push!(LOAD_PATH, pwd())

```

But doing it in a different way would not be a problem for me, as long as vscode finds the referenced modules, functions and variables.

And where in the code is the symbol server process started?

---

<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 9, 2019, 9:04pm UTC](https://discourse.julialang.org/t/how-to-make-vscode-aware-of-user-modules/22948/8 "2019-04-09T21:04:06Z")

</div>

Hm, that is going to be tricky… You are essentially dynamically changing the `LOAD_PATH`, and the whole concept of the language server is that of a static analysis… If you changed `LOAD_PATH` via the env var `JULIA_LOAD_PATH` I could maybe see a scenario where we propagate the content of that env var down to the symbol server process.

The symbol server gets started [here](https://github.com/JuliaEditorSupport/LanguageServer.jl/blob/e8871c657a3c20f062b3b4af29ec08a4449a2305/src/languageserverinstance.jl#L31).

I don’t think we would want to change anything about [JULIA\_DEPO\_PATH](https://docs.julialang.org/en/latest/manual/environment-variables/#JULIA_DEPOT_PATH-1) in your case.

---

<div class="post-metadata">

**Author:** ![garychow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/garychow/32/11734_2.png) [@garychow](https://discourse.julialang.org/u/garychow)\
**Post date:** [December 7, 2019, 2:02pm UTC](https://discourse.julialang.org/t/how-to-make-vscode-aware-of-user-modules/22948/9 "2019-12-07T14:02:25Z")

</div>

Hi @ufechner7,

Would you mind tell me where did you add the push! for LOAD\_PATH, I tried that in scripts/languageserver/main.jl and it doesn’t seem to work…

Thanks

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [December 7, 2019, 2:53pm UTC](https://discourse.julialang.org/t/how-to-make-vscode-aware-of-user-modules/22948/10 "2019-12-07T14:53:31Z")

</div>

It used to work in an old version of the plugin, but it doesn’t work any more. @davidanthoff is the only person who knows how to fix that, but he is short of time.

See also: [https://github.com/julia-vscode/julia-vscode/issues/307](https://github.com/julia-vscode/julia-vscode/issues/307)

---

<div class="post-metadata">

**Author:** ![fpga](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fpga/32/11667_2.png) [@fpga](https://discourse.julialang.org/u/fpga)\
**Post date:** [December 8, 2019, 6:12am UTC](https://discourse.julialang.org/t/how-to-make-vscode-aware-of-user-modules/22948/11 "2019-12-08T06:12:35Z")

</div>

Thanks, I tried push! on both .julia/config/startup.jl and the main.jl in the package, both doesn’t work. So I guess the Linter does not read LOAD\_PATH…

anyway thanks for the great work and I will wait for the next version

---

<div class="post-metadata">

**Author:** ![tseaward](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tseaward/32/15552_2.png) [@tseaward](https://discourse.julialang.org/u/tseaward)\
**Post date:** [May 14, 2020, 8:49am UTC](https://discourse.julialang.org/t/how-to-make-vscode-aware-of-user-modules/22948/12 "2020-05-14T08:49:14Z")

</div>

Having an environment variable or editor setting (e.g. vscode) which contains a list of paths for the symbol server to add would be very useful.

---

<div class="post-metadata">

**Author:** ![koehlerson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/koehlerson/32/13108_2.png) [@koehlerson](https://discourse.julialang.org/u/koehlerson)\
**Post date:** [June 24, 2020, 11:47am UTC](https://discourse.julialang.org/t/how-to-make-vscode-aware-of-user-modules/22948/13 "2020-06-24T11:47:50Z")

</div>

any update on this issue? @davidanthoff

---

<div class="post-metadata">

**Author:** ![Zhong\_Pan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zhong_pan/32/19872_2.png) [@Zhong\_Pan](https://discourse.julialang.org/u/Zhong_Pan)\
**Post date:** [June 28, 2020, 3:05pm UTC](https://discourse.julialang.org/t/how-to-make-vscode-aware-of-user-modules/22948/14 "2020-06-28T15:05:15Z")

</div>

Co-ask. This is a very important feature we are still missing, given that VSCode has advanced quickly on other features. 🙂

---

<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:** [June 28, 2020, 6:00pm UTC](https://discourse.julialang.org/t/how-to-make-vscode-aware-of-user-modules/22948/15 "2020-06-28T18:00:55Z")

</div>

We’re going to tackle the whole module/package/environment story after Juliacon. It is a big lift and will take some time to get right.

---

<div class="post-metadata">

**Author:** ![Zhong\_Pan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zhong_pan/32/19872_2.png) [@Zhong\_Pan](https://discourse.julialang.org/u/Zhong_Pan)\
**Post date:** [June 29, 2020, 6:33pm UTC](https://discourse.julialang.org/t/how-to-make-vscode-aware-of-user-modules/22948/16 "2020-06-29T18:33:59Z")

</div>

Great, thanks!!!

---

<div class="post-metadata">

**Author:** ![mrVeng](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mrveng/32/8836_2.png) [@mrVeng](https://discourse.julialang.org/u/mrVeng)\
**Post date:** [December 30, 2020, 11:33am UTC](https://discourse.julialang.org/t/how-to-make-vscode-aware-of-user-modules/22948/17 "2020-12-30T11:33:13Z")

</div>

> [@davidanthoff](#):
>
> We’re going to tackle the whole module/package/environment story after Juliacon.

@davidanthoff First of all, thank you and the team for your effort!

Is there an update on this situation?

How are people handling a situation where they just want to script and not directly create a package?

EDIT: Making a project of the desired module and then calling submodules from there works without any problems. Sorry for opening up an old post.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [December 30, 2020, 4:24pm UTC](https://discourse.julialang.org/t/how-to-make-vscode-aware-of-user-modules/22948/18 "2020-12-30T16:24:17Z")

</div>

What do you mean with “making a project”? How do you do that?

---

<div class="post-metadata">

**Author:** ![mrVeng](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mrveng/32/8836_2.png) [@mrVeng](https://discourse.julialang.org/u/mrVeng)\
**Post date:** [December 30, 2020, 6:39pm UTC](https://discourse.julialang.org/t/how-to-make-vscode-aware-of-user-modules/22948/19 "2020-12-30T18:39:06Z")

</div>

I am adding a folder to a workspace. With Alt+Enter in the module I could execute sub-folders from this module just as in Atom.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [December 30, 2020, 7:09pm UTC](https://discourse.julialang.org/t/how-to-make-vscode-aware-of-user-modules/22948/20 "2020-12-30T19:09:22Z")

</div>

You could load modules in sub-folders with using?

[Next page](https://discourse.julialang.org/t/how-to-make-vscode-aware-of-user-modules/22948.md?page=2)
