prompt-toolkit / prompt-toolkit/python-prompt-toolkit
Using auto_suggest for copilot-like completions
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 10.6k
- Forks
- 815
- PR merge metrics
- No merged PRs in 30d
Description
I'd like to use auto_suggest for copilot like AI auto-completions. However, there seem to be some complications with doing this:
- auto_suggest only supports completing at the end of the prompt.
- auto_suggest doesn't really seem to work with multiline suggestions. Any newlines in the suggestions are printed as
^J. Additionally, the transformers seem to work line-by-line, so it's not so clear how to even write something that could suggest multiple lines. - The
AppendAutoSuggestionsprocessor is hard-coded in the input processors https://github.com/prompt-toolkit/python-prompt-toolkit/blob/669541123c9a72da1fda662cbd0a18ffe9e6d113/src/prompt_toolkit/widgets/base.py#L240. Meaning even if I write my own processor to handle the above issues, I can't really useAutoSuggestas that processor would try to handle anysuggestionthat is put on the buffer.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading auto_suggest, AppendAutoSuggestions, and the input-processor setup in src/prompt_toolkit/widgets/base.py. Trace how suggestions are limited to the prompt end and how multiline text is transformed and rendered. Done would require a clear design for copilot-like, multiline or custom suggestion handling, including how the hard-coded processor should interact with it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100