From 54ebbcd389784ffde758569e9430efeef4dfc67a Mon Sep 17 00:00:00 2001 From: Alexandr Evstigneev Date: Mon, 1 Feb 2021 15:49:33 +0300 Subject: [PATCH] Allow outer leaves to be reparseable Actually this is a bugfix. Previous fix was intended to permit reparsing of the outer elements, but not actual implementations/tests was introduced. When tried to implement one, found that TreeUtil.containsOuterLanguageElements(astNode) prevents attempt to reparse outer leaf element even if it is marked as reparseable. GitOrigin-RevId: e9aa9482cc9cad33e86c789c24a278bb13da59a8 --- .../src/com/intellij/psi/impl/BlockSupportImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platform/core-impl/src/com/intellij/psi/impl/BlockSupportImpl.java b/platform/core-impl/src/com/intellij/psi/impl/BlockSupportImpl.java index e3c035a93e96..bcbf988be32d 100644 --- a/platform/core-impl/src/com/intellij/psi/impl/BlockSupportImpl.java +++ b/platform/core-impl/src/com/intellij/psi/impl/BlockSupportImpl.java @@ -1,4 +1,4 @@ -// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.psi.impl; @@ -128,7 +128,8 @@ public class BlockSupportImpl extends BlockSupport { final TextRange textRange = astNode.getTextRange(); if (textRange.getLength() + lengthShift > 0 && - (baseLanguage.isKindOf(elementType.getLanguage()) || !TreeUtil.containsOuterLanguageElements(astNode))) { + (baseLanguage.isKindOf(elementType.getLanguage()) || elementType instanceof IReparseableLeafElementType || + !TreeUtil.containsOuterLanguageElements(astNode))) { final int start = textRange.getStartOffset(); final int end = start + textRange.getLength() + lengthShift; if (end > newFileText.length()) {