mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
(RIDER-115237) KnownColorSchemes: get ready for throwing getName() on the color schemes
GitOrigin-RevId: 300aa57cd595fc8c22b9e01e15a894c62b4f27cf
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6058949a50
commit
5627877eca
@@ -3,6 +3,7 @@ package com.intellij.ide.startup.importSettings.transfer.backend.db
|
||||
|
||||
import com.intellij.ide.startup.importSettings.models.BundledEditorColorScheme
|
||||
import com.intellij.openapi.diagnostic.logger
|
||||
import com.intellij.openapi.diagnostic.runAndLogException
|
||||
import com.intellij.openapi.editor.colors.EditorColorsManager
|
||||
|
||||
object KnownColorSchemes {
|
||||
@@ -11,9 +12,9 @@ object KnownColorSchemes {
|
||||
val HighContrast: BundledEditorColorScheme? = findScheme("High contrast")
|
||||
|
||||
private fun findScheme(name: String): BundledEditorColorScheme? = BundledEditorColorScheme.fromManager(name) ?: run {
|
||||
logger.error(
|
||||
"Unable to find bundled color scheme \"$name\". " +
|
||||
"All available schemes: ${EditorColorsManager.getInstance().allSchemes.joinToString(", ", "\"", "\"") { it.name }}.")
|
||||
val names = logger.runAndLogException { EditorColorsManager.getInstance().allSchemes.joinToString(", ", "\"", "\"") { it.name } }
|
||||
?: "[cannot compute]"
|
||||
logger.error("Unable to find bundled color scheme \"$name\". All available schemes: ${names}.")
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user