Eglot or language server: why "Possible method call error"?

Recently, I started to have a lot of green wiggly lines on emacs. For example,

function read_seq_rec(ist, type::DataType)
  header  = read(ist, Int32)
  buffer  = read(ist, type)
  trailer = read(ist, Int32)
  return header, trailer, buffer
end

See the screenshot below, too. I’ve looked at the messages and they are all

[IncorrectCallArgs]: Possible method call error.

I don’t think read(iostream, datatype) is a method call error.

These days, green squiggly lines are too prevalent to be useful. When I started to use Julia (version 1.6), green squiggly lines were really useful. I’m now on Julia 1.10. Does somebody know what’s going on?

image

I can’t reproduce this with Neovim.

This is a frequent complaint but I never have false positives. I wonder what’s different.

2 Likes

Can’t reproduce either with eglot:

Screenshot_2024-02-07_17-41-57

Maybe your LS version is out-of-date? See e.g. here for a way to upgrade

You’ll need to adapt the path to your specific case. You can find the correct path using one of the following methods:

  • M-xeglot-stderr-buffer then you’ll find the correct path at the beginning of the output, or
  • C-hveglot-jl-language-server-project
1 Like

Thank you all for your inputs!

@ffevotte The other thread you quote provides the solution. Specifically,

shell$ cd ~/.emacs.d/elpa/eglot-jl-20230601.1335/
shell$ julia --project=. -e 'import Pkg; Pkg.update()'

fixed my problem.

I shared the elpa directory among my machines via cloud drive, which may have caused this problem. I’ve now moved the .emacs.d directory to each machine, sharing only the init.el file via cloud.

I hope the problem is gone for good.