diff --git a/platform/analysis-api/src/com/intellij/codeInsight/completion/CompletionProcess.java b/platform/analysis-api/src/com/intellij/codeInsight/completion/CompletionProcess.java index 56f667224449..fcea51c9e8e6 100644 --- a/platform/analysis-api/src/com/intellij/codeInsight/completion/CompletionProcess.java +++ b/platform/analysis-api/src/com/intellij/codeInsight/completion/CompletionProcess.java @@ -1,6 +1,16 @@ // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.codeInsight.completion; +/** + * Represents a completion process from the point of view of the completion framework. + * It is started when the user types in the editor or invokes completion explicitly (e.g., by a shortcut). + * It ends when the completion is finished successfully or canceled. + * + * @see CompletionService#getCurrentCompletion + */ public interface CompletionProcess { + /** + * @return {@code true} if completion is triggered by typing in the editor, {@code false} if it's invoked by explicit action (e.g., by a shortcut) + */ boolean isAutopopupCompletion(); } diff --git a/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionPhase.kt b/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionPhase.kt index fbb2d7be495b..01b92dc2dc1b 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionPhase.kt +++ b/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionPhase.kt @@ -60,6 +60,8 @@ import kotlin.math.max * * [EmptyAutoPopup] - completion was triggered by typing, but no completion items were found, and the lookup is not shown * * [InsertedSingleItem] - a single item was found, and it was inserted into the document * * [NoSuggestionsHint] - candidate inference has finished, but no candidates were found and a warning "no suggestions found" is shown. + * + * @See CompletionServiceImpl.completionPhase */ sealed class CompletionPhase @ApiStatus.Internal constructor( @JvmField diff --git a/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionProgressIndicator.java b/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionProgressIndicator.java index 35be029674f0..dcc2f8a7493e 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionProgressIndicator.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionProgressIndicator.java @@ -81,6 +81,9 @@ import static com.intellij.codeInsight.completion.CompletionPhase.CUSTOM_CODE_CO /** * See cancellation logic in {@link CompletionPhase.BgCalculation#restartOnWriteAction)} + * + * @see CompletionService#getCurrentCompletion + * @see CompletionServiceImpl#getCurrentCompletionProgressIndicator() */ @ApiStatus.Internal public final class CompletionProgressIndicator extends ProgressIndicatorBase implements CompletionProcessEx, Disposable {