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()) {