# Can’t make VSCode aware of a local package

**URL:** https://discourse.julialang.org/t/can-t-make-vscode-aware-of-a-local-package/86808
**Category:** VS Code
**Created:** [September 5, 2022, 3:21pm UTC](https://discourse.julialang.org/t/can-t-make-vscode-aware-of-a-local-package/86808 "2022-09-05T15:21:41Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![senhalil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/senhalil/32/42473_2.png) [@senhalil](https://discourse.julialang.org/u/senhalil)
#### Post date: [September 5, 2022, 3:21pm UTC](https://discourse.julialang.org/t/can-t-make-vscode-aware-of-a-local-package/86808/1 "2022-09-05T15:21:41Z")

</div>

If I do as follows, VSCode works as expected – i.e., I can click and go to definition of an exported function from my script and the files defining these functions are parsed correctly, etc. – however, this is not ideal since during active development the module files are modified and I need to restart the REPL session because Revise doesn’t pick up on the changes of included modules:

```julia
include("module_file.jl")
using .MyModule

```

If I include MyModule as a package via `using MyModule`, Revise can pickup the changes; however, now VSCode doesn’t parse the module files and doesn’t let me click&go to definition.

Is there a way to make VSCode parse a local package/module?

---

<div class="post-metadata">

### Author: ![jmair](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jmair/32/35117_2.png) [@jmair](https://discourse.julialang.org/u/jmair)
#### Post date: [September 5, 2022, 10:11pm UTC](https://discourse.julialang.org/t/can-t-make-vscode-aware-of-a-local-package/86808/2 "2022-09-05T22:11:48Z")

</div>

Personally, I use a second environment to `dev` my own packages (modules). I usually keep this second environment in a subfolder of the main package. Using the `dev` mode is simple, instead of doing `] add path/to/package`, you write `] dev path/to/package`. This also plays well with revise and the built in REPL. This allows you to skip the `include` of your own module and just add the using.

If you want to do it in completely separate folders, I would recommend opening up each project (or environment) under the same VS code workspace, so you have access to all the files and it makes navigating between the projects easier and the extensions seem to work better too.

---

<div class="post-metadata">

### Author: ![senhalil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/senhalil/32/42473_2.png) [@senhalil](https://discourse.julialang.org/u/senhalil)
#### Post date: [September 7, 2022, 1:00pm UTC](https://discourse.julialang.org/t/can-t-make-vscode-aware-of-a-local-package/86808/3 "2022-09-07T13:00:52Z")

</div>

> [@jmair](#):
>
> so you have access to all the files and it makes navigating between the projects easier and the extensions seem to work better too.

Thanks for the idea @jmair, I switch the Julia extension of my VSCode to “insider” version and now everything works as expected with `using MyModule` – Revise picks up changes, VSCode lets me go to definition and shows the documentation. It might have been a bug with the julia-vscode-language-server 🤷

---

<div class="post-metadata">

### Author: ![senhalil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/senhalil/32/42473_2.png) [@senhalil](https://discourse.julialang.org/u/senhalil)
#### Post date: [October 14, 2022, 2:03pm UTC](https://discourse.julialang.org/t/can-t-make-vscode-aware-of-a-local-package/86808/4 "2022-10-14T14:03:11Z")

</div>

Unfortunately the plugin stopped working as the insider version is deprecated now ☹

> <https://github.com/julia-vscode/julia-vscode/issues/3118>
>
> However, today when I tried to debug a project, after a month or two gap, the de…bugger does not trigger the debug points but I can still reach the same location from the main script by "stepping in". 
> 
> The debugger used to work with the same project a month or two ago when I was using the insider version 1.7.13 (or a version before) of Julia-vscode.
> 
> Back then I switch to the insider version just because of this issue and now it says it is deprecated " This extension is deprecated. Use the Julia extension instead. "
> 
> Do you have an idea why I could debug using the insider version but not the main version? Can I change a setting as a user to be able to debug my code? Is there a way to use the old insider version the plugin until this issue is fixed?

---

<div class="post-metadata">

### Author: ![senhalil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/senhalil/32/42473_2.png) [@senhalil](https://discourse.julialang.org/u/senhalil)
#### Post date: [October 14, 2022, 2:05pm UTC](https://discourse.julialang.org/t/can-t-make-vscode-aware-of-a-local-package/86808/5 "2022-10-14T14:05:34Z")

</div>

> [@jmair](#):
>
> Using the `dev` mode is simple, instead of doing `] add path/to/package`, you write `] dev path/to/package`. This also plays well with revise and the built in REPL. This allows you to skip the `include` of your own module and just add the using.

Hi @jmair , I do add via `] dev path/to/package` and `using` but the debugger doesn’t trigger the debug points. Do you have any suggestions?

---

<div class="post-metadata">

### Author: ![jmair](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jmair/32/35117_2.png) [@jmair](https://discourse.julialang.org/u/jmair)
#### Post date: [October 14, 2022, 2:23pm UTC](https://discourse.julialang.org/t/can-t-make-vscode-aware-of-a-local-package/86808/6 "2022-10-14T14:23:46Z")

</div>

I use the `@enter` macro to start my debugging:

```julia
@enter my_func()

```

Which should launch the debug mode and step through any of your code as you would expect.

---

<div class="post-metadata">

### Author: ![senhalil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/senhalil/32/42473_2.png) [@senhalil](https://discourse.julialang.org/u/senhalil)
#### Post date: [October 14, 2022, 2:27pm UTC](https://discourse.julialang.org/t/can-t-make-vscode-aware-of-a-local-package/86808/7 "2022-10-14T14:27:15Z")

</div>

It looks like vscode-julia plugin doesn’t recognize that macro:

```julia
┌ Error: Some Julia code in the VS Code extension crashed
└ @ VSCodeDebugger ~/.vscode/extensions/julialang.language-julia-1.37.2/scripts/error_handler.jl:15
ERROR: LoadError: UndefVarError: @enter not defined
Stacktrace:
  [1] top-level scope
    @ :0

```

---

<div class="post-metadata">

### Author: ![jmair](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jmair/32/35117_2.png) [@jmair](https://discourse.julialang.org/u/jmair)
#### Post date: [October 14, 2022, 5:53pm UTC](https://discourse.julialang.org/t/can-t-make-vscode-aware-of-a-local-package/86808/8 "2022-10-14T17:53:02Z")

</div>

That’s strange. I imagine you might need to reinstall VS code (and extensions), or possibly upgrade your julia installation (something like `juliaup` is good for this).

I have no experience with this breaking personally, even switching between the normal and insider versions of the extension.
