# Using LanguageServer.jl with eglot in emacs

**URL:** <https://discourse.julialang.org/t/using-languageserver-jl-with-eglot-in-emacs/23125>\
**Category:** Tooling\
**Tags:** editors, emacs\
**Created:** [April 14, 2019, 1:46am UTC](https://discourse.julialang.org/t/using-languageserver-jl-with-eglot-in-emacs/23125 "2019-04-14T01:46:19Z")\
**Posts on this page:** 1\
**Showing post:** 86

<div class="post-metadata">

**Author:** ![johannesnauta](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johannesnauta/32/47434_2.png) [@johannesnauta](https://discourse.julialang.org/u/johannesnauta)\
**Post date:** [March 7, 2023, 4:48pm UTC](https://discourse.julialang.org/t/using-languageserver-jl-with-eglot-in-emacs/23125/86 "2023-03-07T16:48:34Z")

</div>

I am not sure if this is correct thread to post, but here goes:

I am switching from `lsp-mode` to using `eglot` and `eglot-jl` because I could not correctly configure `lsp-mode` with my current Julia project (e.g. using `Pkg.activate("path/to/project")`). While the `README.md` on the `eglot-jl` clearly states:

> After installation, `eglot-jl-init` will load support for the Julia language server into eglot and project.el. If `eglot-jl-init` has been run in your emacs session, running `eglot` in a `julia-mode` buffer will start a language server for the [Julia project](https://docs.julialang.org/en/v1.1/manual/code-loading/#Project-environments-1) to which the buffer belongs.

I still get linting errors that indicate `Missing reference`s. Does someone maybe have an idea why this is the case? If I look into the `*EGLOT` message buffer it appears to have chosen the correct project, but it still cannot find the modules in my `/src/` directory.

Here is the relevant elisp:

```elisp
(use-package eglot
    :ensure t)

(use-package eglot-jl
    :ensure t)

(use-package julia-mode
    :ensure t
    :mode "\\.jl\\'"
    :interpreter "julia"
    :config
    (eglot-jl-init)
    ;; Specify the hook that connects =eglot=
    :hook (julia-mode . eglot-ensure))

```

And, perhaps useful, an overview of my `tree` can be checked in [this question](https://discourse.julialang.org/t/revise-pkg-pkgtemplates-pkgskeleton-and-smooth-julia-package-development/95608), but basically boils down to:

```bash
Project.toml
|- src/
|--- Main.jl
|- examples/
|--- example.jl

```

The linting errors appear in `example.jl` with contents

```julia
using Main
Main.someFunction()

```

Note that the code does work inside a Julia REPL, so I believe it is not an issue of a wrong `import`/`using` statement.

---

_[View the full topic](https://discourse.julialang.org/t/using-languageserver-jl-with-eglot-in-emacs/23125)._
