diff --git a/platform/testFramework/src/com/intellij/openapi/util/registry/RegistryTestUtil.kt b/platform/testFramework/src/com/intellij/openapi/util/registry/RegistryTestUtil.kt index 316d75df65ef..f6d490a8ef05 100644 --- a/platform/testFramework/src/com/intellij/openapi/util/registry/RegistryTestUtil.kt +++ b/platform/testFramework/src/com/intellij/openapi/util/registry/RegistryTestUtil.kt @@ -11,4 +11,15 @@ inline fun RegistryValue.withValue(tempValue: Boolean, crossinline block: () -> finally { setValue(currentValue) } -} \ No newline at end of file +} + +inline fun RegistryValue.withValue(tempValue: String, crossinline block: () -> Unit) { + val currentValue = asBoolean() + try { + setValue(tempValue) + block() + } + finally { + setValue(currentValue) + } +}