non-Jedi / eglot-jl

Wrapper for using Julia LanguageServer.jl with emacs eglot
Creative Commons Zero v1.0 Universal
61 stars 11 forks source link

Make eglot recognize ESS[julia] mode #47

Closed gav451 closed 6 months ago

gav451 commented 6 months ago

I have installed julia-mode following the steps of ESS Wiki Julia which opens Julia files in ESS[julia] mode which eglot did not recognize.

gav451 commented 6 months ago

I am just starting to play with Julia and I got it working with LanguageServer v4.5.1 which takes a long time to start and is very verbose. It looks like https://github.com/gdkrmr/lsp-julia/blob/c869b2f6c05a97e5495ed3cc6710a33b4faf41a2/lsp-julia.el#L274 uses a SymbolServer cache. Is there a way to filter all "note" language server messages to reduce the verbosity?

non-Jedi commented 6 months ago

Thanks @gav451!

Where are these "note" messages you're seeing? I don't think I understand the verbosity issue you're having.

gav451 commented 6 months ago

For the Julia fragment:

# [[file:julia-mandelbrot.org::mandelbrot][mandelbrot]]
function mandelbrot(a)
    z = 0
    for i=1:50
        z = z^2 + a
    end
    return z
end
# mandelbrot ends here

# [[file:julia-mandelbrot.org::loop][loop]]
for y=1.0:-0.05:-1.0
    for x=-2.0:0.0315:0.5
        abs(mandelbrot(complex(x, y))) < 2 ? print("*") : print(" ")
    end
    println()
end
# loop ends here

I see in eglot's flymake diagnostics buffer (line, column, type, ...):

    4   8 note     e-f-b    Julia [UnusedBinding]: Variable has been assigned but not used.
   14   8 note     e-f-b    Julia [IncorrectCallArgs]: Possible method call error.
   14  37 note     e-f-b    Julia [IncorrectCallArgs]: Possible method call error.
   14  45 note     e-f-b    Julia [IncorrectCallArgs]: Possible method call error.
   14  58 note     e-f-b    Julia [IncorrectCallArgs]: Possible method call error.
   16   4 note     e-f-b    Julia [IncorrectCallArgs]: Possible method call error.

which is in my opinion very verbose (and I have no idea how to change the code to make those messages disappear).

I am running Emacs-30.0.50

gav451 commented 6 months ago

I have synced my local git repo and now I have only 4 8 note e-f-b Julia [UnusedBinding]: Variable has been assigned but not used. which is looks fine to me.