Minimal changes to allow multiline suggestions.#1948
Merged
jonathanslenders merged 2 commits intoprompt-toolkit:masterfrom Jan 1, 2025
Merged
Minimal changes to allow multiline suggestions.#1948jonathanslenders merged 2 commits intoprompt-toolkit:masterfrom
jonathanslenders merged 2 commits intoprompt-toolkit:masterfrom
Conversation
I'm trying to be the least invasive; But the idea is to allow access to previous lines when rendering a line in order to shift them down; and display multiline sugestions. With this I can add minimal modification into IPython that allows multiline suggestion (typically would be created by an LLM – while not a big fan, there is a lot of requests for it. I'm going to assume there is no willingness tochange the current API for transformers to get at least a ranges of lines instead of lines, it would be easier to handle. I do not include any update to the transformers we use in IPython to display those completions; but once battled tested a bit more, I'm happy to contribute it as well.
Member
|
Thank you! |
Contributor
Author
|
Thanks, and happy new year. I'll contribute some examples that show how one can achieve showing multiple lines later this month. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm trying to be the least invasive;
But the idea is to allow access to previous lines when rendering a line in order to shift them down; and display multiline sugestions.
With this I can add minimal modifications into IPython that allows multiline suggestions (typically would be created by an LLM – while not a big fan, there is a lot of requests for it.
I'm going to assume there is no willingness tochange the current API for transformers to get at least a ranges of lines instead of lines, it would be easier to handle.
I do not include any update to the transformers we use in IPython to display those completions; but once battled tested a bit more, I'm happy to contribute it as well.
Here is what it could looks like in IPython for example.
Screen.Recording.2024-12-19.at.14.03.28.mov