prompt-toolkit / python-prompt-toolkit

Library for building powerful interactive command line applications in Python
https://python-prompt-toolkit.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
9.28k stars 715 forks source link

Feature Request: Include parentheses when tab completing functions #1261

Open mskar opened 3 years ago

mskar commented 3 years ago

IPython, ptpython, and radian all use prompt-toolkit and all three do not include parentheses when completing functions.

Tab completion in IPython even shows functions with parentheses in the completion menu: image but when I tab complete a function the parentheses are not included: image I would like tab completion of functions to also add parentheses and put my cursor inside the parentheses: image

Adding parentheses to completed functions is the default behavior in

I think this feature would be widely appreciated by users and should be the default behavior for tab completion of functions. Is there a way we could completion to add parentheses for all three projects (IPython, ptpython, and radian)?

RyannDaGreat commented 3 years ago

You don't need to modify prompt toolkit to do this. You can modify the completer object to accomplish this. I don't remember exactly how but since it can also complete file paths it's very flexible.