From 32790b35a9b0668e40d658e4630bd8dbecf8202b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann=20C=C3=A9bron?= Date: Wed, 13 Sep 2023 09:34:28 +0200 Subject: [PATCH] stub_indexes.md: note IStubElementType#isAlwaysLeaf() --- topics/basics/indexing_and_psi_stubs/stub_indexes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/topics/basics/indexing_and_psi_stubs/stub_indexes.md b/topics/basics/indexing_and_psi_stubs/stub_indexes.md index 76246fe7b..8c29b4e1b 100644 --- a/topics/basics/indexing_and_psi_stubs/stub_indexes.md +++ b/topics/basics/indexing_and_psi_stubs/stub_indexes.md @@ -56,6 +56,7 @@ For each element type that needs to be stored in the stub tree, perform the foll Implement the `createPsi()` and `createStub()` methods for creating PSI from a stub and vice versa. Implement the `serialize()` and `deserialize()` methods for storing the data in a binary stream. Override `getExternalId()` according to common used `externalIdPrefix` for the language. + For always-leaf stub nodes return `true` from `isAlwaysLeaf()` (2023.3). 6. Use the class implementing `IStubElementType` as the element type constant when parsing ([example](%gh-ic%/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/parsing/PropertiesElementTypes.java)). 7. Make sure all methods in the PSI element interface access the stub data rather than the PSI tree when appropriate ([example: `Property.getKey()` implementation](%gh-ic%/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/psi/impl/PropertyImpl.java)).