You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's an annoyance that the REPL prints out all possibilities the first time hitting the tab. It would be much better if it simply autocompleted as much as possible and waited for a subsequent tab before printing out all matches. Here's an example usages:
> Bu<TAB>.al<TAB>U<TAB>S<TAB>
To produce Buffer.allocUnsafeSlow, but in doing so I get a screen filled with matches that I know I don't want.
Throwing this out there in case anyone wants to take care of it before I do (which I don't plan to in the near future).
@mscdex@trevnorris FYI, Its implemented for .editor mode (PR link). If .editor mode is good to go, I'll update PR to support least common prefix based tab completion for default mode.
Oh, and adding to the wishlist for tab-completion, require('path').<TAB> could suggest all return properties from that function call.
That would be awesome, but these kind of things get really tricky, as require()ing a module can have side effects and tab completion never should have any.
Activity
princejwesley commentedon Jul 12, 2016
@mscdex @trevnorris FYI, Its implemented for
.editormode (PR link). If.editormode is good to go, I'll update PR to supportleast common prefixbased tab completion for default mode.Fishrock123 commentedon Jul 12, 2016
We should do this with or without
.editorsupport.princejwesley commentedon Jul 12, 2016
yes, since editor mode PR has support for LCP Tab completion, I thought of modify it to support for all cases.
silverwind commentedon Jul 12, 2016
Would very much like this feature. We can probably re-use some code, because this works:
trevnorris commentedon Jul 12, 2016
Ooh. How about automatic path searching? e.g.
require('./foo<TAB>:)silverwind commentedon Jul 12, 2016
Already kind of works, but it wrongly expands
require('./<TAB>to stuff insidenode_modules.Oh, and adding to the wishlist for tab-completion,
require('path').<TAB>could suggest all return properties from that function call.addaleax commentedon Jul 12, 2016
That would be awesome, but these kind of things get really tricky, as
require()ing a module can have side effects and tab completion never should have any.silverwind commentedon Jul 13, 2016
True, probably not worth the risk and hassle to implement something timeout-based.
princejwesley commentedon Jul 13, 2016
Incorporated tab completion support in #7275
addaleax commentedon Jul 15, 2016
PR for solving this on the
readlinelevel: #7754readline: show completions only after 2nd TAB
trevnorris commentedon Aug 9, 2016
Whoot! Thanks @addaleax
readline: show completions only after 2nd TAB