How to create an inline completion that can be accepted on Tab

Answered

Hi all. I'm working on a IntelliJ plugin and trying to create an inline completion suggestion that gets generated after a shortcut. The functionality should very much resemble the one from the inline completion suggestion of the IntelliJ AI Assistant. I've been considering using the CompletionContributor endpoint but I can't make it work exactly as I need to since this doesn't directly generate the code in the editor. So to simplify: users uses a shortcut and in the editor appears suggested code that can be accepted or not. How to achieve that?

Thanks in advance :)

0
1 comment

Hi Michał,

See com.intellij.codeInsight.inline.completion.InlineCompletionProvider.

You can find example implementations on IntelliJ Platform Explorer: https://plugins.jetbrains.com/intellij-platform-explorer/extensions?extensions=com.intellij.inline.completion.provider

0

Please sign in to leave a comment.