Stream: helpdesk (published)

Topic: LanguageServer.jl and meta-programming


view this post on Zulip Filippos Christou (Feb 10 2023 at 12:26):

is it only me that I might not have something well configured or generally LanguageServer.jl and meta-programming don't dance together ?
If that's the out of the box state, are there any nifty solutions ?

view this post on Zulip Sukera (Feb 10 2023 at 12:40):

sadly that's the state of things :/

view this post on Zulip Filippos Christou (Feb 10 2023 at 12:52):

hmm. any possible solutions or even discussions in the horizon ? this can get rather wild with package using a lot of macros (like JuMP.jl and Makie.jl to name a few popular ones)

view this post on Zulip Sukera (Feb 10 2023 at 12:54):

macros are tricky because they are running actual user code on the source AST

view this post on Zulip Sukera (Feb 10 2023 at 12:54):

maybe @Sebastian Pfitzner knows about this though

view this post on Zulip Filippos Christou (Feb 10 2023 at 13:00):

I completely lack how knowledge on how LanguageServer.jl works at the moment. Does it not evaluate anything and just does static AST analysis ? then it's tough.

view this post on Zulip Filippos Christou (Feb 10 2023 at 13:01):

what about JET.jl ? I think JET interprets some code and as I see here it also expands the macros. that should work..

view this post on Zulip Filippos Christou (Feb 10 2023 at 13:02):

I remember some discussion about incorcporating JET as a linter and I've heard VSCode people already have something that works, but not sure what the stage is there for big adoption in LanguageServer.jl

view this post on Zulip Sukera (Feb 10 2023 at 13:03):

JET works on a completely different level

view this post on Zulip Sukera (Feb 10 2023 at 13:04):

you wouldn't use JET solely as a linter, you're probably thinking of the (not at all finished/workable) https://github.com/aviatesk/JETLS.jl

view this post on Zulip Sukera (Feb 10 2023 at 13:05):

which tries to incorporate the things JET.jl reports as issues via a LanguageServer

view this post on Zulip Sukera (Feb 10 2023 at 13:05):

doesn't integrate with the existing LanguageServer.jl

view this post on Zulip Sukera (Feb 10 2023 at 13:06):

at the moment, LS.jl does its own parsing, but I'm not sure that it actually expands macros during that (as that may have sideffects)

view this post on Zulip Sebastian Pfitzner (Feb 10 2023 at 13:21):

in theory we could do some very limited analysis of macro code, but a generic solution is not really possible with the current LS.jl design

view this post on Zulip Filippos Christou (Feb 10 2023 at 13:29):

julia has some introspection tools, like@which, methods, .... ofc to use these you need to evaluate the code. Does the current design of LanguageServer.jl make use of such tools , i.e. evaluates the code ?

view this post on Zulip Sukera (Feb 10 2023 at 13:31):

The core issue is that the language server would need to get VASTLY more information from a julia session that has loaded the package code. There just is no way a julia session in the current form can provide that information though, especially not for top level code (which is evaluated eagerly)


Last updated: Nov 22 2024 at 04:41 UTC