# VSCode and LangServer don't recognize local package

**URL:** <https://discourse.julialang.org/t/vscode-and-langserver-dont-recognize-local-package/113709>\
**Category:** VS Code\
**Created:** [May 1, 2024, 9:54pm UTC](https://discourse.julialang.org/t/vscode-and-langserver-dont-recognize-local-package/113709 "2024-05-01T21:54:21Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![feribg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/feribg/32/202948_2.png) [@feribg](https://discourse.julialang.org/u/feribg)\
**Post date:** [May 1, 2024, 9:54pm UTC](https://discourse.julialang.org/t/vscode-and-langserver-dont-recognize-local-package/113709/1 "2024-05-01T21:54:21Z")

</div>

I am working on a package locally and it seems like VSCode + LangServer don’t recognize the references to the package and it’s exported methods.

For example:

```julia
using TestPackage
using CSV
using DataFrames
using BenchmarkTools
using TestPackage.SomeModule: update!

```

Here TestPackage and all the references would get a `not defined` error with yellow underscores, in the imports as well as all references in the file. However when executed with the repl within VSCode everything works fine.

I already tried restarting, clearning the cache, `dev .` and `activate .`

What is the recommended approach to locally develop a package and make the tools aware of it when within that repo.

I also tried to exclude the package name and do a relative import like so but then not only the language server errors out, so does the repl, with not found:

```julia
using ..SomeModule: update!

```

---

<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:** [May 2, 2024, 1:33am UTC](https://discourse.julialang.org/t/vscode-and-langserver-dont-recognize-local-package/113709/2 "2024-05-02T01:33:32Z")

</div>

Sometimes adding a line like:

```julia
if false; include("../src/flightpathcontroller.jl"); end

```

helps…

---

<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:** [May 2, 2024, 1:38am UTC](https://discourse.julialang.org/t/vscode-and-langserver-dont-recognize-local-package/113709/3 "2024-05-02T01:38:31Z")

</div>

Try this [GitHub - PetrKryslUCSD/VSCode\_Julia\_portable: Portable Julia running in VSCode](https://github.com/PetrKryslUCSD/VSCode_Julia_portable), perhaps?

---

<div class="post-metadata">

**Author:** ![dylanxyz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dylanxyz/32/36646_2.png) [@dylanxyz](https://discourse.julialang.org/u/dylanxyz)\
**Post date:** [May 2, 2024, 2:04am UTC](https://discourse.julialang.org/t/vscode-and-langserver-dont-recognize-local-package/113709/4 "2024-05-02T02:04:53Z")

</div>

Another option, let’s say your project structure is something like:

```julia
TestPackage/
   src/
      TestPackage.jl
      foobar.jl
   examples/
      basic_example.jl
      another_example.jl

```

If you want intellisense to work insde `examples/` you can create another environment inside that folder and `dev`’ your package into it.

```julia
$ cd TestPackage/examples
$ julia
julia> ]
(@v1.10) pkg> activate .
(examples) pkg> dev ..

```

After that you should probably `add` other packages you’re gonna be `using`:

```julia
(examples) pkg> add CSV DataFrames BenchmarkTools

```

Then, you can change the vscode julia environment to that folder:

Press `CTRL + SHIFT + P` and search for this command: `Julia> Change Current Environment`

![image](https://global.discourse-cdn.com/julialang/original/3X/2/3/230c3c5337a0f3bddb0cfa13184a7a2aaad880b8.png)

Select `(pick a folder)`.

![image](https://global.discourse-cdn.com/julialang/original/3X/c/d/cd08989b6ddf7416c7c63d57133688bbc7e1bd0b.png)

Then pick the folder that you want.

Then, wait for vscode to reindex the packages and now you should have intellisense working for your package.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/e/b/eb9205c6cdd696afa8d2120c65cb77593cd5b73b.png)

If intellisense still doesn’t work, restart vscode and make sure you’re in the correct environment.

Of course, the downside of this approach is to have to keep changing/creating environments just to get intellisense to work.

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [May 2, 2024, 6:04am UTC](https://discourse.julialang.org/t/vscode-and-langserver-dont-recognize-local-package/113709/5 "2024-05-02T06:04:11Z")

</div>

Related topic:

> [@For which packages does VSCode autocomplete work?](https://discourse.julialang.org/t/for-which-packages-does-vscode-autocomplete-work/101360/4):
>
> Let’s say I’m developing a package called MyPackage and I have activated its Project.toml. It has one dependency called MyDependency, and one test depency called MyTestDependency. After some exploration, it seems that IntelliSense… works for MyDependency if either one of the following conditions is satisfied there is a using MyDependency statement at the top of my file my file is in src/ and included in the module MyPackage (which also contains the using MyDependency statement) never works…

---

<div class="post-metadata">

**Author:** ![feribg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/feribg/32/202948_2.png) [@feribg](https://discourse.julialang.org/u/feribg)\
**Post date:** [May 2, 2024, 4:01pm UTC](https://discourse.julialang.org/t/vscode-and-langserver-dont-recognize-local-package/113709/6 "2024-05-02T16:01:33Z")

</div>

> [@ufechner7](#):
>
> ```julia
> if false; include("../src/flightpathcontroller.jl"); end
> 
> ```

Seems like most solutions revolve around this. I tried that and it doesn’t work for me using `TestItemRunner.jl` not native tests, which is the required package to run tests in VSCode (althought its broken on its own).

The solution with multiple packages within the package works, but its very very cumbersome to be practical and keep all deps in sync.

I’m quite surprised using the default tools i can’t get the tests to recognize the package they are testing, this has to be a bug ?

---

<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:** [May 2, 2024, 4:17pm UTC](https://discourse.julialang.org/t/vscode-and-langserver-dont-recognize-local-package/113709/7 "2024-05-02T16:17:09Z")

</div>

> [@feribg](#):
>
> this has to be a bug

There are 51 open bugs on this topic: [Issues · julia-vscode/julia-vscode · GitHub](https://github.com/julia-vscode/julia-vscode/labels/area-ls-linter)

Just run your tests from the package manager using the `test` command… Don’t rely too much on VSCode…

---

<div class="post-metadata">

**Author:** ![wangfh5](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wangfh5/32/204858_2.png) [@wangfh5](https://discourse.julialang.org/u/wangfh5)\
**Post date:** [December 22, 2024, 8:46am UTC](https://discourse.julialang.org/t/vscode-and-langserver-dont-recognize-local-package/113709/8 "2024-12-22T08:46:12Z")

</div>

Thanks for your workaround. I just realize that the environment of the REPL and the environment of VS Code window can be different.

---

<div class="post-metadata">

**Author:** ![SonLe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sonle/32/9507_2.png) [@SonLe](https://discourse.julialang.org/u/SonLe)\
**Post date:** [February 13, 2026, 7:47pm UTC](https://discourse.julialang.org/t/vscode-and-langserver-dont-recognize-local-package/113709/9 "2026-02-13T19:47:06Z")

</div>

Sorry to bring this up again, I also faced this problem. The workaround of @dylanxyz worked but I wonder is this a bug or at least there could be more correct way to fix this issue.

---

<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:** [February 14, 2026, 1:00am UTC](https://discourse.julialang.org/t/vscode-and-langserver-dont-recognize-local-package/113709/10 "2026-02-14T01:00:25Z")

</div>

> [@SonLe](#):
>
> more correct way to fix this issue

Try if [GitHub - aviatesk/JETLS.jl: A new language server for Julia, enabling modern, compiler-powered tooling.](https://github.com/aviatesk/JETLS.jl) fixes this for you.

---

<div class="post-metadata">

**Author:** ![SonLe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sonle/32/9507_2.png) [@SonLe](https://discourse.julialang.org/u/SonLe)\
**Post date:** [February 18, 2026, 2:50pm UTC](https://discourse.julialang.org/t/vscode-and-langserver-dont-recognize-local-package/113709/11 "2026-02-18T14:50:30Z")

</div>

I can confirm JETLS is helpful for this problem. It is sometimes laggy and warns some wrong errors but I think that’s ok due to still being in development process
