From 3fa3ba3685db683210d557bbe6bcd0ffd0e787fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann=20C=C3=A9bron?= Date: Wed, 1 Feb 2023 18:04:12 +0100 Subject: [PATCH] syntax_highlighting_and_error_highlighting.md: DumbAware Annotator --- topics/appendix/api_notable/api_notable_list_2023.md | 3 +++ .../syntax_highlighting_and_error_highlighting.md | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/topics/appendix/api_notable/api_notable_list_2023.md b/topics/appendix/api_notable/api_notable_list_2023.md index 012ecc81b..f264fa88e 100644 --- a/topics/appendix/api_notable/api_notable_list_2023.md +++ b/topics/appendix/api_notable/api_notable_list_2023.md @@ -17,3 +17,6 @@ Nested Index Access File Type Index Topic : [`FileTypeIndex.IndexChangeListener`](%gh-ic-master%/platform/indexing-api/src/com/intellij/psi/search/FileTypeIndex.java) allows monitoring addition/removal of files by `FileType`. + +Run Annotator During Indexing +: [Annotators](syntax_highlighting_and_error_highlighting.md#annotator) can implement `DumbAware` to run during indexing (e.g., providing additional syntax highlighting). diff --git a/topics/reference_guide/custom_language_support/syntax_highlighting_and_error_highlighting.md b/topics/reference_guide/custom_language_support/syntax_highlighting_and_error_highlighting.md index 1f95e57b1..2a536b2da 100644 --- a/topics/reference_guide/custom_language_support/syntax_highlighting_and_error_highlighting.md +++ b/topics/reference_guide/custom_language_support/syntax_highlighting_and_error_highlighting.md @@ -81,6 +81,8 @@ Annotators can analyze not only the syntax, but also the semantics using PSI, an The annotator can also provide quick fixes to problems it detects. When the file is changed, the annotator is called incrementally to process only changed elements in the PSI tree. +Annotators not requiring information from [indexes](indexing_and_psi_stubs.md) may implement [`DumbAware`](%gh-ic%/platform/core-api/src/com/intellij/openapi/project/DumbAware.java) to work during indexing (e.g., for additional [syntax highlighting](#syntax)). (2023.1+) + > See also [Code Inspections](code_inspections_and_intentions.md) which offer a more fine-grained control and some additional features. > {style="note"} @@ -113,7 +115,7 @@ Call `createWarningAnnotation()`/`createErrorAnnotation()` on the [`AnnotationHo ### Syntax -To apply additional syntax highlighting (2020.1 and later): +To apply additional syntax highlighting: