From 25158735116da66138b3d36ebb2ec67bbfd3ee82 Mon Sep 17 00:00:00 2001 From: Peter Gromov Date: Mon, 8 Jun 2020 09:04:41 +0200 Subject: [PATCH] ILazyParseableElementTypeBase.reuseCollapsedTokens javadoc GitOrigin-RevId: a1fdbae7db3cddf873a083c2031838f254a93fcf --- .../com/intellij/psi/tree/ILazyParseableElementTypeBase.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platform/core-api/src/com/intellij/psi/tree/ILazyParseableElementTypeBase.java b/platform/core-api/src/com/intellij/psi/tree/ILazyParseableElementTypeBase.java index b4bb91858a1d..85d5d7712fd1 100644 --- a/platform/core-api/src/com/intellij/psi/tree/ILazyParseableElementTypeBase.java +++ b/platform/core-api/src/com/intellij/psi/tree/ILazyParseableElementTypeBase.java @@ -34,6 +34,11 @@ public interface ILazyParseableElementTypeBase { */ ASTNode parseContents(@NotNull ASTNode chameleon); + /** + * @return whether it's safe during lazy parsing to reuse tokens that were previously collapsed into a single token of this + * type via {@link com.intellij.lang.PsiBuilder.Marker#collapse}. This can increase lazy-parsing speed + * (by not having to run the lexer again), but requires additional memory to store the tokens. + */ default boolean reuseCollapsedTokens() { return false; }