Autocomplete deletes a line on pressing TAB


We are developing a custom language plugin for IntelliJ with autocomplete support.

For InsertionContext in handleInsert(), the completion character is set to "\n" and addCompletionChar is set to false. While using the plugin, when the user presses TAB on an autocomplete option, a line is getting deleted. When user presses ENTER, that's not the case. What could be causing this issue?

1 comment
Comment actions Permalink

When Tab is pressed, the part of the identifier or the reference after the caret is deleted. You can debug which code invokes com.intellij.codeInsight.completion.CompletionInitializationContext#setReplacementOffset and sets the offset after the line end there.


Please sign in to leave a comment.