LanguageServer.jl
LanguageServer.jl copied to clipboard
Code completion for interfaces
Here is a fun idea: Provide templates for interfaces. I.e. I want to provide an iterator interface for the type T
LanguageServer.jl
could provide skeletons for all required functions. Not sure how much hand holding is required. Here is an example:
function Base.iterate(x::T)
if # condition that the iterator has finished
return nothing
else
# element = the element
# next = next state
(element, next)
end
end
function Base.iterate(x::T, state)
end
#= optional functions
function Base.eltype(::Type{T})
end
function Base.length(t::T)
end
=#
Hm, couldn't this be done with some sort of snippet in VS Code?
In general, this seems too specific to me, in particular given that Julia doesn't have a notion of a formal interface.