# Autocomplete for keys of keyword arguments; is it possible?

**URL:** <https://discourse.julialang.org/t/autocomplete-for-keys-of-keyword-arguments-is-it-possible/70780>\
**Category:** General Usage\
**Created:** [November 2, 2021, 4:06am UTC](https://discourse.julialang.org/t/autocomplete-for-keys-of-keyword-arguments-is-it-possible/70780 "2021-11-02T04:06:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![xinchin](https://avatars.discourse-cdn.com/v4/letter/x/54ee81/32.png) [@xinchin](https://discourse.julialang.org/u/xinchin)\
**Post date:** [November 2, 2021, 4:06am UTC](https://discourse.julialang.org/t/autocomplete-for-keys-of-keyword-arguments-is-it-possible/70780/1 "2021-11-02T04:06:21Z")

</div>

is there anyway to have autocomplete for keyword arguments?

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [November 2, 2021, 6:00am UTC](https://discourse.julialang.org/t/autocomplete-for-keys-of-keyword-arguments-is-it-possible/70780/2 "2021-11-02T06:00:47Z")

</div>

In what editor? Repl?

---

<div class="post-metadata">

**Author:** ![xinchin](https://avatars.discourse-cdn.com/v4/letter/x/54ee81/32.png) [@xinchin](https://discourse.julialang.org/u/xinchin)\
**Post date:** [January 7, 2022, 2:46am UTC](https://discourse.julialang.org/t/autocomplete-for-keys-of-keyword-arguments-is-it-possible/70780/3 "2022-01-07T02:46:02Z")

</div>

Any one, REPL, etc.

---

<div class="post-metadata">

**Author:** ![gustaphe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gustaphe/32/18174_2.png) [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Post date:** [January 7, 2022, 7:54am UTC](https://discourse.julialang.org/t/autocomplete-for-keys-of-keyword-arguments-is-it-possible/70780/4 "2022-01-07T07:54:15Z")

</div>

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.

```nohighlight
# 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)`.

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [January 7, 2022, 9:31am UTC](https://discourse.julialang.org/t/autocomplete-for-keys-of-keyword-arguments-is-it-possible/70780/5 "2022-01-07T09:31:41Z")

</div>

[https://github.com/JuliaLang/julia/pull/43536](https://github.com/JuliaLang/julia/pull/43536)

---

<div class="post-metadata">

**Author:** ![Lightup1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lightup1/32/35410_2.png) [@Lightup1](https://discourse.julialang.org/u/Lightup1)\
**Post date:** [October 21, 2022, 1:22pm UTC](https://discourse.julialang.org/t/autocomplete-for-keys-of-keyword-arguments-is-it-possible/70780/6 "2022-10-21T13:22:01Z")

</div>

Is there a way to do that in vscode?  
I turned run time complete on but it does not autocomplete kwargs of functions in `Makie.jl`.
