How does autocompletion work in pkg mode?

I’m confused by the autocompletion in REPL package manager mode: If I type

pkg> add Static

then this completed (in gray) to “add StaticArrays”. However, if I hit TAB, then the completion disappears, presumably because there are other possible choices (that are displayed if I hit TAB again). How can I accept the autocompleted suggestion?

Oh that might be a bit unfortunate. If you hit twice you see the full list of 31 packages starting with Static and if you hit A and then TAB it autocompletes to StaticArray.

So maybe the array hint is a bit (one key) early actually?

I think this is a bug - while the feature was called “hinting” in the 1.11 release announcement here:

the description says it should be “hinting when there’s a singular completion available”. Checking quickly for two of my packages this works (e.g. add Synth will not offer a hint, but add SynthC will offer SynthControl and tab to autocomplete works), but it seems to go wrong in other cases.

Maybe @ianshmean can chime in.

It’s more than that. StaticA + TAB autocompletes to StaticArray, but not to the suggested StaticArrays because there are still three other possible choices.

Ah yes, because at that point there are still 4 choices of actual packages left. Then the suggestion is maybe just the most likely one? Still a bit strange.

It shouldn’t inline the StaticArrays completion after just writing Static. That’s buggy.

1 Like

I’ve posted an issue on GitHub.