Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic multiline suggestion example #1953

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Carreau
Copy link
Contributor

@Carreau Carreau commented Jan 7, 2025

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)), as get_line is only available since #1948

@Carreau Carreau force-pushed the multiline-suggest-example branch from 869b4b7 to c680c9f Compare January 7, 2025 13:49
@Carreau Carreau force-pushed the multiline-suggest-example branch from c680c9f to 42fb728 Compare January 8, 2025 09:16
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.
@Carreau Carreau force-pushed the multiline-suggest-example branch from 42fb728 to 61188a9 Compare January 8, 2025 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant