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
This commit is contained in:
Alexandr Evstigneev
2021-02-01 14:01:08 +00:00
committed by intellij-monorepo-bot
parent bb440db5b2
commit 54ebbcd389
@@ -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()) {