Minimal changes to allow multiline suggestions. #1948
Merged
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