From ba48df28003fcb3dda59fbc26e283dac4d16dfa2 Mon Sep 17 00:00:00 2001 From: Dmitry Batkovich Date: Wed, 11 Feb 2026 10:24:28 +0100 Subject: [PATCH] cleanup [whats new]: fix warnings and dead code Signed-off-by: Dmitry Batkovich GitOrigin-RevId: 8f8a0023012821cf77cbcfb6ca9df520e8cd8450 --- .../src/com/intellij/platform/whatsNew/WhatsNewBundle.kt | 6 +++--- .../src/com/intellij/platform/whatsNew/WhatsNewContent.kt | 8 ++------ .../platform/whatsNew/WhatsNewShowOnStartCheckService.kt | 1 - 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewBundle.kt b/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewBundle.kt index 2da056a00653..644ca061fed1 100644 --- a/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewBundle.kt +++ b/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewBundle.kt @@ -6,12 +6,12 @@ import org.jetbrains.annotations.Nls import org.jetbrains.annotations.PropertyKey object WhatsNewBundle { - private const val pathToBundle = "messages.WhatsNewBundle" - private val bundle by lazy { DynamicBundle(WhatsNewBundle::class.java, pathToBundle); } + private const val BUNDLE = "messages.WhatsNewBundle" + private val bundle by lazy { DynamicBundle(WhatsNewBundle::class.java, BUNDLE); } @Nls fun message( - @PropertyKey(resourceBundle = pathToBundle) key: String, + @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any ): String { return bundle.getMessage(key, *params) diff --git a/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewContent.kt b/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewContent.kt index 4096fd0075ea..0490337f0da5 100644 --- a/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewContent.kt +++ b/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewContent.kt @@ -44,7 +44,7 @@ import kotlinx.coroutines.withContext import java.net.HttpURLConnection import java.net.URL -internal abstract class WhatsNewContent() { +internal abstract class WhatsNewContent { companion object { suspend fun getWhatsNewContent(): WhatsNewContent? { return if (WhatsNewInVisionContentProvider.getInstance().isAvailable() && @@ -57,10 +57,6 @@ internal abstract class WhatsNewContent() { ExternalProductResourceUrls.getInstance().whatIsNewPageUrl?.toDecodedForm()?.let { WhatsNewUrlContent(it) } } } - - suspend fun hasWhatsNewContent() = WhatsNewInVisionContentProvider.getInstance().isAvailable() - || ExternalProductResourceUrls.getInstance().whatIsNewPageUrl != null - } // Year and release have to be strings, because this is the ApplicationInfo.xml format. @@ -169,7 +165,7 @@ internal class WhatsNewVisionContent(val contentProvider: WhatsNewInVisionConten const val WHATS_NEW_VISION_SCHEME = "whatsnew-vision" const val LOCALHOST = "localhost" - private const val THEME_KEY = "\$__VISION_PAGE_SETTINGS_THEME__$" + private const val THEME_KEY = $$"$__VISION_PAGE_SETTINGS_THEME__$" private const val DARK_THEME = "dark" private const val LIGHT_THEME = "light" diff --git a/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewShowOnStartCheckService.kt b/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewShowOnStartCheckService.kt index b066d189f2b2..329ded33a87e 100644 --- a/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewShowOnStartCheckService.kt +++ b/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewShowOnStartCheckService.kt @@ -81,7 +81,6 @@ internal class WhatsNewStatus { } internal class WhatsNewShowOnStartCheckService(private val environment: WhatsNewEnvironmentAccessor) : ProjectActivity { - @Suppress("unused") // used by the component container constructor() : this(WhatsNewEnvironmentAccessorImpl()) private val wasStarted = AtomicBoolean(false)