diff --git a/plugins/yaml/src/org/jetbrains/yaml/completion/YamlKeyCompletionInsertHandler.java b/plugins/yaml/src/org/jetbrains/yaml/completion/YamlKeyCompletionInsertHandler.java index c9bb18ba08f9..e5e74ab0db1e 100644 --- a/plugins/yaml/src/org/jetbrains/yaml/completion/YamlKeyCompletionInsertHandler.java +++ b/plugins/yaml/src/org/jetbrains/yaml/completion/YamlKeyCompletionInsertHandler.java @@ -39,7 +39,7 @@ public abstract class YamlKeyCompletionInsertHandler im PsiFile psiFile = context.getFile(); YamlOffsetContext offsetContext = new YamlOffsetContext(psiFile, startOffset); @SuppressWarnings("DataFlowIssue") - YAMLValue oldValue = (offsetContext.holdingDocument.getTopLevelValue() instanceof YAMLMapping) ? + YAMLValue oldValue = (offsetContext.holdingDocument.getTopLevelValue() instanceof YAMLCompoundValue) ? deleteLookupTextAndRetrieveOldValue(context, offsetContext.currentElement) : null; // Inheritors must handle lookup text removal since otherwise holdingDocument may become invalid. if (oldValue instanceof YAMLSequence) {