From 613b7dbb141b0173a9ea22bf3aef069c83c302c4 Mon Sep 17 00:00:00 2001 From: Ivan Migalev Date: Fri, 28 Mar 2025 18:46:05 +0100 Subject: [PATCH] What's New: code & warning cleanup (cherry picked from commit 2d6cc4600e3548e856d6d7327ce37706fbec2971) GitOrigin-RevId: f71d90b69e19c44aaa14b9a1e17355fc82503fb9 --- .../intellij/platform/whatsNew/WhatsNewAction.kt | 15 +++++---------- .../whatsNew/WhatsNewInVisionContentProvider.kt | 4 ++-- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewAction.kt b/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewAction.kt index 1caf4d932053..05a3c7250d72 100644 --- a/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewAction.kt +++ b/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewAction.kt @@ -23,19 +23,12 @@ import org.jetbrains.concurrency.await internal class WhatsNewAction : AnAction(), com.intellij.openapi.project.DumbAware { companion object { - private val LOG = logger() internal const val PLACE = "WhatsNew" - private const val REACTIONS_STATE = "whatsnew.reactions.state" - private val reactionChecker = FUSReactionChecker(REACTIONS_STATE) - - fun refresh() { - reactionChecker.clearLikenessState() - if (LOG.isTraceEnabled) { - LOG.trace("EapWhatsNew reaction refresh") - } - } } + private val REACTIONS_STATE = "whatsnew.reactions.state" + private val reactionChecker = FUSReactionChecker(REACTIONS_STATE) + private val hasWhatsNewContent by lazy { appScope.async { WhatsNewContent.hasWhatsNewContent() @@ -89,3 +82,5 @@ private fun Project.getScope() = this.service().scope private class AppScopeProvider(val scope: CoroutineScope) private val appScope: CoroutineScope get() = service().scope + +private val LOG = logger() diff --git a/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewInVisionContentProvider.kt b/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewInVisionContentProvider.kt index 61b1c387f16a..851bc8586ba3 100644 --- a/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewInVisionContentProvider.kt +++ b/platform/whatsNew/src/com/intellij/platform/whatsNew/WhatsNewInVisionContentProvider.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. @file:OptIn(ExperimentalSerializationApi::class) package com.intellij.platform.whatsNew @@ -100,7 +100,7 @@ class ResourceContentSource(private val classLoader: ClassLoader, private val re override suspend fun openStream(): InputStream? = withContext(Dispatchers.IO) { classLoader.getResourceAsStream(resourceName) } - override suspend fun checkAvailability() = withContext(Dispatchers.IO) { + override suspend fun checkAvailability(): Boolean = withContext(Dispatchers.IO) { classLoader.getResource(resourceName) != null } } \ No newline at end of file