void (@NotNull YAMLKeyValue keyValue) { if (keyValue.getKey() == null) { return; } if ("<<".equals(keyValue.getKey().getText())) { // validation of merge types is not supported, but at least there should be no red code return; } YamlMetaTypeProvider.MetaTypeProxy meta = myMetaTypeProvider.getKeyValueMetaType(keyValue); if (meta == null) { YAMLValue parent = keyValue.getParentMapping(); if (parent != null) { final YamlMetaTypeProvider.MetaTypeProxy typeProxy = myMetaTypeProvider.getValueMetaType(parent); if (typeProxy == null) { return; } // Only mark the first element as unknown, not its children // // Also if it's a mapping instead of expected scalar type, // don't report key-specific errors as they're redundant ("scalar value expected" error is already reported) YamlMetaType parentMetaType = typeProxy.getMetaType(); if(parentMetaType instanceof YamlScalarType || parentMetaType instanceof YamlArrayType) { return; } } String msg = YAMLBundle.message("YamlUnknownKeysInspectionBase.unknown.key", keyValue.getKeyText()); myProblemsHolder.registerProblem(keyValue.getKey(), msg, ProblemHighlightType.LIKE_UNKNOWN_SYMBOL); } }