[spring-boot] yaml: fix creating key in a document with top level compound value

GitOrigin-RevId: 89f37c8514e21860b85ada91d636e1e4e8a5cccd
This commit is contained in:
Konstantin Aleev
2024-01-25 22:08:36 +00:00
committed by intellij-monorepo-bot
parent 38b9c46055
commit e4cd6efb49
@@ -39,7 +39,7 @@ public abstract class YamlKeyCompletionInsertHandler<T extends LookupElement> 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) {