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

Function "exported" from let block is not recognized #43

Closed ryofurue closed 1 year ago

ryofurue commented 1 year ago

I'm sorry if this is not the right place to post this, but . . . as in the following code, the function defined in, and "exported from", a let block is flagged as "Missing reference" by eglot-jl:

let x = 1
  global func # "Missing reference"
  function func()
    x += 1
    println(x)
  end
end

func()  # "Missing reference"
func()  # "Missing reference"

The lack of function-local "static" variables in Julia means that the above is the recommended way:

https://stackoverflow.com/questions/24541723/does-julia-support-static-variables-with-function-scope

The above sample code compiles and runs with julia 1.9.2 without any error. I'm using eglot-jl-20230601.1335 (from melpa) on Emacs 29.1.

non-Jedi commented 1 year ago

Hi @ryofurue. Thanks for reporting this issue. Poking around, it looks like this is an upstream issue still unresolved even on the master branches of the LanguageServer.jl packages:

There's not really anything eglot can do to mitigate this issue, so I'm going to close this in favor of the upstream bugs.

ryofurue commented 1 year ago

@non-Jedi Thank you for your kind message and sorry for my spurious report! That's exactly what I meant by "I'm sorry if this is not the right place to post this".