LanguageServer.jl
LanguageServer.jl copied to clipboard
Custom completions in macro context
This might be too specific to be implemented in the LanguageServer, but for consideration
Inside the context of macro, I would like the ability to hook into the autocomplete machinery and provide custom completions. E.g., consider the simplified example below, where ns. is spot I'd like to intercept.
I'd imagine this as an argument to the instantiation, something like like LanguageServerInstance(; macro_complections=Dict(:dsl => my_custom_completion_function)?
macro dsl(namespace, blk)
# ....
end
@dsl ns begin
function calc()
return ns. # < custom tab completion here >
end
end
Agreed, it would be very nice if we had a mechanism that allowed macros to hook into the LS. That will require a lot of thinking, thought, to come up with a way that works with our stability guarantees and is still general enough.
Somewhat related, but I'd also like for a way to convey more information about syntax too, to affect syntax highlighting. I think that could make macros easier to debug (?) for the people writing them. I believe Language Servers can provide semantic information about syntax, right?