code_completion.md: CompletionContributor mention DumbAware

This commit is contained in:
Yann Cébron 2024-03-13 18:00:32 +01:00
parent fe6ce73c1a
commit 5fe4e0113b
2 changed files with 4 additions and 1 deletions

View File

@ -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).

View File

@ -1,4 +1,4 @@
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
<!-- Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
# 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)