Using LanguageServer.jl with eglot in emacs

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 to which the buffer belongs.

I still get linting errors that indicate Missing references. 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:

(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, but basically boils down to:

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

The linting errors appear in example.jl with contents

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.

1 Like