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

feat: Allow **Ctrl+Space** to toggle whether or not word completions are displayed #687

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,13 @@ private void addCompletionItems(@NotNull CompletionParameters parameters,
}
}

// If completions were added from LSP and this is auto-completion or the explicit completion trigger was typed
// only once, add completions from other all other contributors except for the word completion contributor.
// If completions were added from LSP and this is auto-completion or the explicit completion was triggered an
// odd number of times (acts as a toggle), add completions from other all other contributors except for the
// word completion contributor.
// Note that the word completion contributor only really kicks in when LSP completions are added in the context
// of a TextMate file (see TextMateCompletionContributor), but that's going to be very common for LSP usage
// since it's often adding (pseudo-)language support when not already present in the host JetBrains IDE.
if ((size > 0) && (parameters.getInvocationCount() < 2)) {
if ((size > 0) && ((parameters.getInvocationCount() == 0) || ((parameters.getInvocationCount() % 2) > 0))) {
// Don't allow automatic execution of the remaining completion contributors; we'll execute them ourselves below
result.stopHere();

Expand Down
Loading