# Tab completion to find methods for given variable(s)

**URL:** <https://discourse.julialang.org/t/tab-completion-to-find-methods-for-given-variable-s/66076>\
**Category:** VS Code\
**Created:** [August 9, 2021, 2:48pm UTC](https://discourse.julialang.org/t/tab-completion-to-find-methods-for-given-variable-s/66076 "2021-08-09T14:48:24Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![ert](https://avatars.discourse-cdn.com/v4/letter/e/b5ac83/32.png) [@ert](https://discourse.julialang.org/u/ert)\
**Post date:** [August 9, 2021, 2:48pm UTC](https://discourse.julialang.org/t/tab-completion-to-find-methods-for-given-variable-s/66076/1 "2021-08-09T14:48:25Z")

</div>

I just noticed that [https://github.com/JuliaLang/julia/pull/38791](https://github.com/JuliaLang/julia/pull/38791) for the REPL got merged to be included in the next Julia version. This means that the REPL will tab-complete statements like `?(x, y)` to yield all methods that apply to `x` and `y`. Is there something similar planned for the VSCode extension?

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [August 9, 2021, 2:49pm UTC](https://discourse.julialang.org/t/tab-completion-to-find-methods-for-given-variable-s/66076/2 "2021-08-09T14:49:47Z")

</div>

Yes, eventually.

---

<div class="post-metadata">

**Author:** ![ert](https://avatars.discourse-cdn.com/v4/letter/e/b5ac83/32.png) [@ert](https://discourse.julialang.org/u/ert)\
**Post date:** [August 9, 2021, 3:02pm UTC](https://discourse.julialang.org/t/tab-completion-to-find-methods-for-given-variable-s/66076/3 "2021-08-09T15:02:49Z")

</div>

Thanks for the fast reply and that you are planning to integrate this. Does this concern the language server side mainly inside `textDocument_completion_request` ? If there’s no-one working on this yet, I could try to prototype something in a PR.

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [August 9, 2021, 3:06pm UTC](https://discourse.julialang.org/t/tab-completion-to-find-methods-for-given-variable-s/66076/4 "2021-08-09T15:06:04Z")

</div>

Yes, but I’d also like to see some improvements to have a better in-editor UX than having to type that `?`. Feel free to play around with this though 😉

---

<div class="post-metadata">

**Author:** ![ert](https://avatars.discourse-cdn.com/v4/letter/e/b5ac83/32.png) [@ert](https://discourse.julialang.org/u/ert)\
**Post date:** [August 9, 2021, 3:10pm UTC](https://discourse.julialang.org/t/tab-completion-to-find-methods-for-given-variable-s/66076/5 "2021-08-09T15:10:23Z")

</div>

Sure! Let’s keep some ideas posted here - my first and most blasphemic one would be to just allow OO-like `variable.<tab>` instead of `?(variable,<tab>` - but I guess it will take a longer discussion until something is fixed.

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [August 9, 2021, 3:12pm UTC](https://discourse.julialang.org/t/tab-completion-to-find-methods-for-given-variable-s/66076/6 "2021-08-09T15:12:58Z")

</div>

Honestly, just `(variable,<tab>`/`(variable,variable2)<tab>`/ `<tab>(variable,variable2)` might work just fine.

---

<div class="post-metadata">

**Author:** ![ert](https://avatars.discourse-cdn.com/v4/letter/e/b5ac83/32.png) [@ert](https://discourse.julialang.org/u/ert)\
**Post date:** [August 9, 2021, 3:16pm UTC](https://discourse.julialang.org/t/tab-completion-to-find-methods-for-given-variable-s/66076/7 "2021-08-09T15:16:05Z")

</div>

You’re right, the first idea was complete nonsense, since it masks struct members with loads of methods. I think your variant without the “?” is a very natural one!

---

<div class="post-metadata">

**Author:** ![aviatesk](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aviatesk/32/7610_2.png) [@aviatesk](https://discourse.julialang.org/u/aviatesk)\
**Post date:** [August 9, 2021, 3:42pm UTC](https://discourse.julialang.org/t/tab-completion-to-find-methods-for-given-variable-s/66076/8 "2021-08-09T15:42:28Z")

</div>

I’d like to vote for `(variable,<tab>`.

---

<div class="post-metadata">

**Author:** ![ert](https://avatars.discourse-cdn.com/v4/letter/e/b5ac83/32.png) [@ert](https://discourse.julialang.org/u/ert)\
**Post date:** [August 9, 2021, 4:43pm UTC](https://discourse.julialang.org/t/tab-completion-to-find-methods-for-given-variable-s/66076/9 "2021-08-09T16:43:18Z")

</div>

++ `(variables,<tab>` as well as `(variables)<tab>` for a fixed number of arguments in addition as in the REPL. I’m anyway wondering why they choose to use `?`, as it clashes with the help system.

I filed an issue [https://github.com/julia-vscode/LanguageServer.jl/issues/979](https://github.com/julia-vscode/LanguageServer.jl/issues/979)  
and a PR [https://github.com/julia-vscode/LanguageServer.jl/pull/980](https://github.com/julia-vscode/LanguageServer.jl/pull/980) .

Hope to have something useful soon.

---

<div class="post-metadata">

**Author:** ![ert](https://avatars.discourse-cdn.com/v4/letter/e/b5ac83/32.png) [@ert](https://discourse.julialang.org/u/ert)\
**Post date:** [August 9, 2021, 4:45pm UTC](https://discourse.julialang.org/t/tab-completion-to-find-methods-for-given-variable-s/66076/10 "2021-08-09T16:45:49Z")

</div>

One more thing: Per default, Julia matches also methods where any type is allowed as a method argument. This is a bit problematic, as the number of matches becomes very large. Should one limit the completions at least to exclude `Any` as a type?

---

<div class="post-metadata">

**Author:** ![qwjyh](https://avatars.discourse-cdn.com/v4/letter/q/a4c791/32.png) [@qwjyh](https://discourse.julialang.org/u/qwjyh)\
**Post date:** [February 22, 2024, 12:15am UTC](https://discourse.julialang.org/t/tab-completion-to-find-methods-for-given-variable-s/66076/11 "2024-02-22T00:15:04Z")

</div>

I recently found an issue about this problem on the Julia github repository.  
[https://github.com/JuliaLang/julia/issues/52661#issuecomment-1872156534](https://github.com/JuliaLang/julia/issues/52661#issuecomment-1872156534)

---

<div class="post-metadata">

**Author:** ![xgdgsc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xgdgsc/32/608_2.png) [@xgdgsc](https://discourse.julialang.org/u/xgdgsc)\
**Post date:** [February 24, 2024, 2:47am UTC](https://discourse.julialang.org/t/tab-completion-to-find-methods-for-given-variable-s/66076/12 "2024-02-24T02:47:39Z")

</div>

You can try my branch [Feat/methodswith dot completion by xgdgsc · Pull Request #3240 · julia-vscode/julia-vscode (github.com)](https://github.com/julia-vscode/julia-vscode/pull/3240) at [Release A quick dot methods completion demo · xgdgsc/julia-vscode (github.com)](https://github.com/xgdgsc/julia-vscode/releases/tag/v1.41.1_methodswith)
