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

InlineCompletion Not Triggered on accepting when "command" option provided to InlineCompletionItem. #894

Open
Tracked by #922
AyushVachaspati opened this issue Jul 4, 2023 · 2 comments
Assignees

Comments

@AyushVachaspati
Copy link

AyushVachaspati commented Jul 4, 2023

When I add a command to the InlineCompletionItem, the command is executed on accepting the suggestion, but provideInlineCompletionItems is not triggered again.
But if I remove the command from the InlineCompletionItem, the provideInlineCompletionItems is triggered when I accept the completion.
I think this might be a bug, since accepting partial completions do trigger provideInlineCompletionItems, so I would expect that accepting full completion should do the same.
Is there a workaround for this, as I want the completions to be triggered as soon as the user accepts the current suggestion.

In this case the provideInlineCompletionItems is triggered on accepting
image
VS
In this case InlineCompletions is not triggered, but the command provided is triggered.
image

@AyushVachaspati AyushVachaspati changed the title Inline Completion Not Triggered When "command" option provided to InlineCompletionItem. InlineCompletion Not Triggered on accepting when "command" option provided to InlineCompletionItem. Jul 4, 2023
@AyushVachaspati
Copy link
Author

I tried using void vscode.commands.executeCommand("editor.action.inlineSuggest.trigger"); in the command I am calling to make it fire the inlineCompletion. But this is not working either, but if I trigger the same command from the Command Pallet using ctrl+shift+P -> Trigger Inline Completion, it does trigger my completion function.

This is the command that is called after the completion is accepted.
image

This is the logs showing that the completion is triggered when typing.. but when I accept the function above is called and the logs are printed.. but the inline completion is never triggered.
image

Seems like I'm missing something, but I'm pretty new to this so I'm lost. The inlineCompletion is triggering if I just exlude the printLog command from the completionItem.

@AyushVachaspati
Copy link
Author

Looks like I have a workaround for this. Setting a delay to the inlineSuggest call makes it work. I tried it down to 1ms, and even that seems to work. I'm probably doing something very dumb, hope someone more experienced is able to tell me what I need to do differently to make this work without this hack.
Thanks a lot in advance.
image

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