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

Feature: option to complete word by word; option to complete line by line #1536

Closed
xuyangy opened this issue Apr 24, 2023 · 5 comments
Closed

Comments

@xuyangy
Copy link

xuyangy commented Apr 24, 2023

For some completion sources such as Tabnine or Copilot, the completion items are usually multiple words or even multiple lines. However, often times, the whole multi-word or multi-line completion item is not exactly what one needs. It will be really convenient to be able to complete word by word and line by line.

@xuyangy xuyangy changed the title Feature: option to complete a word; option to complete a line Feature: option to complete word by word; option to complete a line by line Apr 24, 2023
@xuyangy xuyangy changed the title Feature: option to complete word by word; option to complete a line by line Feature: option to complete word by word; option to complete line by line Apr 24, 2023
@Shougo
Copy link

Shougo commented Apr 24, 2023

I think you should upload the examples.

It will be really convenient to be able to complete word by word and line by line.

And it should be requested in source level?

@hrsh7th
Copy link
Owner

hrsh7th commented Apr 25, 2023

This plugin based on the LSP spec. I have no plan to do this.

@hrsh7th hrsh7th closed this as completed Apr 25, 2023
@xuyangy
Copy link
Author

xuyangy commented Apr 25, 2023

Thanks @hrsh7th @Shougo for a quick reply.
When I type I want a b, assume the first completion item is beautiful dog. If I press Enter, I will accept that as a whole and I will have I want a beautiful dog.

What I want is another mapping, say <C-w> to accept only the first space separated word, i.e. when I press <C-w>, I want to have I want a beautiful. Then the popup will be closed and reopened with updated completions. Of course I can continue typing like I want a beautiful cat.

@Shougo, I was thinking that the source can be the same as whatever the LSP supply, the preview, document etc will all be the same. It's only when I "confirm", I want to intercept the completion text the LSP supply, split it by space or by newline and insert the first word or first line into the buffer instead of the whole completion text.

@Shougo
Copy link

Shougo commented Apr 25, 2023

Hm.. I understand.

@MatejBransky
Copy link

Here is the related discussion where I've added a recording of how it works in the VS Code: #1579

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

No branches or pull requests

4 participants