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

InlineCompletionItemProvider.handleDidPartiallyAcceptCompletionItem accepted length is dependent on the trigger #234330

Open
hstaudacher opened this issue Nov 21, 2024 · 0 comments
Assignees

Comments

@hstaudacher
Copy link

Does this issue occur when all extensions are disabled?: No because the API needs to be implemented by an extension

  • VS Code Version: 1.96.0-insider and earlier
  • OS Version: Mac OS X 10.5

The InlineCompletionItemProvider.handleDidPartiallyAcceptCompletionItem method has 2 problems:

  1. The acceptedLength depends on the trigger kind. Let's look at a scenario in the screenshot:
    Image
    Here we see that a partial acceptance should apply the word unction which has 7 characters. If I accept partially using the suggestion widget the method gets invoked with 7. If I accept the suggestion partially using cmd + -> the method gets invoked with 14. This makes computation very hard.
  2. The problem gets even harder because the acceptedLength and PartialAcceptInfo are not passed in a single method call. First the method with the length is invoked before you invoke the same method with the info object. Because of the first issue we need to know the trigger kind in order to compute the length correctly. I think PartialAcceptInfo should at least contain the acceptedLength to avoid implementors to cache the length across several method invocations.
@hstaudacher hstaudacher changed the title InlineCompletionItemProvider.handleDidPartiallyAcceptCompletionItem accepted length is dependent on the trigger InlineCompletionItemProvider.handleDidPartiallyAcceptCompletionItem accepted length is dependent on the trigger Nov 21, 2024
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

2 participants