is there anyway to have autocomplete for keyword arguments?
1 Like
In what editor? Repl?
Any one, REPL, etc.
I donāt remember why I asked, because I donāt think itās implemented anywhere. In theory, you could have the repl use the definitions of functions to do this, and editors could at least complete for any function definitions in your files^ā . But I donāt think any do. Part of the reason is that a lot of functions accept any keyword argument, function f(x; kwargs...)
, so it would probably be a lot of work for a feature that doesnāt even apply half of the time.
^ā Note that thereās a hazard here, since different methods can accept different kwargs.
# In a file you don't own
function cook(p::Potato; peeled=false)
# definition
end
# in your file
function cook(c::Chicken; plucked=true)
# definition
end
Auto complete would now suggest cook(potato; plucked)
.
1 Like
5 Likes