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

Complete word by word #86

Open
TerminalFi opened this issue Feb 16, 2023 · 5 comments
Open

Complete word by word #86

TerminalFi opened this issue Feb 16, 2023 · 5 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@TerminalFi
Copy link
Owner

Sometimes a completion is partially correct, the first x words or lines. It might be neat to add a complete word command that can be continuously pressed to incrementally complete the current suggestion

@timfjord
Copy link
Collaborator

I also noticed this, and this might be related to the latest announcements.

@TerminalFi TerminalFi added enhancement New feature or request good first issue Good for newcomers labels Aug 30, 2023
@creyes-pcty
Copy link

creyes-pcty commented Mar 4, 2024

I just tried to enable this using the same naming conventions as copilot.vim.

{
    "keys": ["alt+right"],
    "command": "copilot_accept_word",
    "context": [
      {
        "key": "setting.copilot.completion.is_visible"
      }
    ]
  },

I don't think LSP-copilot supports copilot_accept_word yet but it'd be nice if it did. I sometimes find the autocompletion is mostly right but I don't want to autocomplete for the whole thing.

@beautifulcoder
Copy link

@jfcherng Does this seem feasible? From looking at the plugin code I think it is doable but I would need a bit more hand holding for a PR.

# chop this up word by word instead of the entire completion text
self.view.insert(edit, source_line_region.end(), completion["completionText"])

@jfcherng
Copy link
Collaborator

jfcherng commented Mar 7, 2024

@jfcherng Does this seem feasible? From looking at the plugin code I think it is doable but I would need a bit more hand holding for a PR.

# chop this up word by word instead of the entire completion text
self.view.insert(edit, source_line_region.end(), completion["completionText"])

I think you looked into a wrong place (panel completion). For normal autocompletion, it should be

self.view.insert(edit, source_line_region.begin(), completion["text"])

It's probably a little confusing since it may be not obvious from the UI that what will happen after completing a word because there is no preview for the "word" only. And after completing a word, what should happen to the UI?

@TerminalFi
Copy link
Owner Author

I've thought about this, and it only really makes sense if Sublime had Ghost text support.

Come on HQ :(

Without it, I would expect the completion popup to reappears with the completion text minus the accepted word.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants