From e4cd6efb493fb07e8d83baeba590e31ad4935986 Mon Sep 17 00:00:00 2001 From: Konstantin Aleev Date: Thu, 25 Jan 2024 12:11:12 +0100 Subject: [PATCH] [spring-boot] yaml: fix creating key in a document with top level compound value GitOrigin-RevId: 89f37c8514e21860b85ada91d636e1e4e8a5cccd --- .../yaml/completion/YamlKeyCompletionInsertHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) {