Basic multiline suggestion example#1953
Merged
jonathanslenders merged 1 commit intoprompt-toolkit:masterfrom Jan 17, 2025
Merged
Basic multiline suggestion example#1953jonathanslenders merged 1 commit intoprompt-toolkit:masterfrom
jonathanslenders merged 1 commit intoprompt-toolkit:masterfrom
Conversation
869b4b7 to
c680c9f
Compare
c680c9f to
42fb728
Compare
Unline inlne completion; this is a bit more tricky to set up, in particular it is hard to choose default that will suit everyone – whether to shift existing line, how to accept/reject, show elision... So we just for now add an example on how this can be used. I will most likely make use of it in IPython in the next few weeks/month, and can report back on the usability.
42fb728 to
61188a9
Compare
Member
|
Thank you! Really appreciated! I hope to do a release in the coming days. |
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.
Unlike inline completion; this is a bit more tricky to set up, in particular it is hard to choose default that will suit everyone – whether to shift existing line, how to accept/reject, show elision...
So we just for now add an example on how this can be used.
I will most likely make use of it in IPython in the next few weeks/month, and can report back on the usability.
This follows #1948, which enable multiline suggestion. Here I show how to use it with a custom preprocessor that will try to fill in multiline text by pushing the existing text down when rendering.
Screen.Recording.2025-01-07.at.14.41.36.mov
This is of course just an example as it does not handle accepting the suggestion; or marking that text has been pushed past the end of the buffer and is not shown.
All this rely on the
return Transformation(ti.get_line(shift)), asget_lineis only available since #1948