# Lsp-julia (Emacs) not detecting installed packages. (And REPL extra)

**URL:** https://discourse.julialang.org/t/lsp-julia-emacs-not-detecting-installed-packages-and-repl-extra/60837
**Category:** New to Julia
**Tags:** emacs, languageserver
**Created:** [May 9, 2021, 6:41pm UTC](https://discourse.julialang.org/t/lsp-julia-emacs-not-detecting-installed-packages-and-repl-extra/60837 "2021-05-09T18:41:30Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Qfl3x](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/qfl3x/32/16227_2.png) [@Qfl3x](https://discourse.julialang.org/u/Qfl3x)
#### Post date: [May 9, 2021, 6:41pm UTC](https://discourse.julialang.org/t/lsp-julia-emacs-not-detecting-installed-packages-and-repl-extra/60837/1 "2021-05-09T18:41:30Z")

</div>

[Using Doom Emacs]

I’ve been trying to setup my Doom Emacs install, while I’ve managed to make lsp-mode work with Julia through this small piece:

```julia
(after! julia-mode
  (add-hook! 'julia-mode-hook
    (setq-local lsp-enable-folding t
                lsp-folding-range-limit 100)))

```

I haven’t managed to make lsp detect the installed packages. I’ve setup my `lsp-julia-default-environment’ to mine but it still doesn’t work.

Doom Emacs uses `lsp-julia` package for Emacs.

REPL extra: (Maybe an extra thread?) I frequently work with Julia in multithreaded mode but the startup delay and memory footprintm makes it so I don’t want it to be the default option every time I want to tinker with something. I’ve found that I could setup several possible Julia executables [here](https://github.com/tpapp/julia-repl), but I don’t know how to make it so the second one spawns a Julia REPL with the `-p` option.

---

<div class="post-metadata">

### Author: ![Satvik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/satvik/32/20486_2.png) [@Satvik](https://discourse.julialang.org/u/Satvik)
#### Post date: [May 9, 2021, 7:01pm UTC](https://discourse.julialang.org/t/lsp-julia-emacs-not-detecting-installed-packages-and-repl-extra/60837/2 "2021-05-09T19:01:10Z")

</div>

It’s not a direct answer, but I’ve found `eglot-jl` a bit easier to get working in Doom than `lsp-mode`: [GitHub - non-Jedi/eglot-jl: Wrapper for using Julia LanguageServer.jl with emacs eglot](https://github.com/non-Jedi/eglot-jl)

---

<div class="post-metadata">

### Author: ![Satvik](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/satvik/32/20486_2.png) [@Satvik](https://discourse.julialang.org/u/Satvik)
#### Post date: [May 10, 2021, 5:50am UTC](https://discourse.julialang.org/t/lsp-julia-emacs-not-detecting-installed-packages-and-repl-extra/60837/3 "2021-05-10T05:50:40Z")

</div>

To add some detail, with eglot-jl you can just set: `(setq eglot-jl-language-server-project "path/to/my/project")`

With lsp it should be `lsp-julia-default-environment`

---

<div class="post-metadata">

### Author: ![Qfl3x](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/qfl3x/32/16227_2.png) [@Qfl3x](https://discourse.julialang.org/u/Qfl3x)
#### Post date: [May 10, 2021, 10:08am UTC](https://discourse.julialang.org/t/lsp-julia-emacs-not-detecting-installed-packages-and-repl-extra/60837/4 "2021-05-10T10:08:35Z")

</div>

Managed to make both work but I have issues with both:

1- `eglot` is slow when dealing with out-of-file declarations that have been included or imported.

2- `lsp-julia`’s indexing takes ages and apparently I have to do it every time I update my install. It’s also not light on the CPU in normal workload.

It appears the thing I need to really change is my CPU in all this. Thanks @Satvik !
