From 5fe4e0113ba6ac57d47af99c26ec3be402b6895e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann=20C=C3=A9bron?= Date: Wed, 13 Mar 2024 18:00:32 +0100 Subject: [PATCH] code_completion.md: CompletionContributor mention DumbAware --- topics/basics/indexing_and_psi_stubs.md | 1 + .../custom_language_support/code_completion.md | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/topics/basics/indexing_and_psi_stubs.md b/topics/basics/indexing_and_psi_stubs.md index 20a915243..ca8320247 100644 --- a/topics/basics/indexing_and_psi_stubs.md +++ b/topics/basics/indexing_and_psi_stubs.md @@ -35,6 +35,7 @@ Violations are reported via [`IndexNotReadyException`](%gh-ic%/platform/core-api It also provides ways of delaying code execution until indexes are ready. ### `DumbAware` API +{id="DumbAwareAPI"} Implementations of certain [](plugin_extension_points.md) can be marked as available during Dumb Mode by implementing [`DumbAware`](%gh-ic%/platform/core-api/src/com/intellij/openapi/project/DumbAware.java). diff --git a/topics/reference_guide/custom_language_support/code_completion.md b/topics/reference_guide/custom_language_support/code_completion.md index 53ab081d2..d32cd3ebb 100644 --- a/topics/reference_guide/custom_language_support/code_completion.md +++ b/topics/reference_guide/custom_language_support/code_completion.md @@ -1,4 +1,4 @@ - + # Code Completion @@ -48,6 +48,8 @@ The core scenario of using [`CompletionContributor`](%gh-ic%/platform/analysis-a Keep in mind that the pattern is checked against the leaf PSI element. If you want to match a composite element, use `withParent()` or `withSuperParent()` methods. +If completion items do not depend on indexes (e.g., keywords), it can be marked as [dumb aware](indexing_and_psi_stubs.md#DumbAwareAPI). + **Examples**: - [`CompletionContributor`](%gh-ij-plugins%/osmorc/src/org/osmorc/manifest/completion/OsgiManifestCompletionContributor.java) for completing keywords in MANIFEST.MF files. - [Custom Language Support Tutorial: Completion Contributor](completion_contributor.md)