LanguageServer.jl
LanguageServer.jl copied to clipboard
Hope to provide more powerful autocompletion about fields of struct
In the testfunc function, julia-vscode can normally provide the fields autocompletion of the variables eg and gp3, but it can not provide the fields completion of the others gp1 and gp2.
I understand that if fields completion is provided, the type of variable must be inferred automatically, which may require a lot of work to be done. However, the fields autocompletion of gp2 whose type is specified explicitly should be as normal as function parameter eg or local variable gp3 .
Thanks very much for your great works.
mutable struct SlipGaussPoint
x::Float64
y::Float64
end
mutable struct SlipEdge
gausspoints::Vector{SlipGaussPoint}
end
function testfunc(eg::SlipEdge)
gp1 = eg.gausspoints[2]
gp2::SlipGaussPoint = eg.gausspoints[1]
gp3 = SlipGaussPoint(1.0, 2.0)
return nothing
end
I think a problem similar (identical?) to this came up on zulip today:
This successfully shows completion:

While this breaks:

Is there a concrete place I could begin hacking on this/what is causing this? I've run into this & similar issues often and I'm close to the point of trying to fix it just to have peace of mind.