gcv / julia-snail

An Emacs development environment for Julia
GNU General Public License v3.0
230 stars 21 forks source link

julia-snail--repl-completions should return nil when no completions are found #34

Closed dahtah closed 3 years ago

dahtah commented 4 years ago

MRE:

ELISP> (with-current-buffer "test_buffer.jl" (julia-snail--repl-completions "xyz"))
:nothing

Should return nil instead, this makes company-capf complain. I'll fix this unless someone does it first.

orialb commented 4 years ago

I wonder where this :nothing is coming from, because the command that runs on the server side is returning an empty array when no completions are found (and I thought completion at point should be ok with empty lists as the result, but maybe I'm wrong):

julia> JuliaSnail.replcompletion("xyz",Main) == []
true

Is the Snail server translating empty arrays to nothing when sending the results back?

orialb commented 4 years ago

Oh, I guess this is due to this line in julia-snail--send-to-server which will cause it to return :nothing when an empty array is returned from the server (since it gets translated to '() which in turn is equivalent to nil): https://github.com/gcv/julia-snail/blob/aeaef908faaa4b8a4f308e396c3f99e9f2da0321/julia-snail.el#L439

gcv commented 4 years ago

Fixed in f4f483e, now in MELPA. Please take a look.