[java-console] EA-1054212 Support for dumb mode and edt thread in ClassLoggingConsoleFilterProvider

- use platform dumb mode notification
- add support for COMMON_LOGGING_MAVEN

GitOrigin-RevId: fc032001197ff5a132f2b7300111c8ef8845dc65
This commit is contained in:
Mikhail Pyltsin
2024-02-07 13:13:25 +01:00
committed by intellij-monorepo-bot
parent 28c8c92318
commit 5033bf919e
2 changed files with 10 additions and 6 deletions

View File

@@ -12,7 +12,8 @@ import com.intellij.psi.search.GlobalSearchScope
const val SLF4J_MAVEN = "org.slf4j:slf4j-api" const val SLF4J_MAVEN = "org.slf4j:slf4j-api"
private const val LOG4J_MAVEN = "org.apache.logging.log4j:log4j-api" private const val LOG4J_MAVEN = "org.apache.logging.log4j:log4j-api"
private val LOG_MAVEN = setOf(SLF4J_MAVEN, LOG4J_MAVEN) private const val COMMON_LOGGING_MAVEN = "commons-logging:commons-logging"
private val LOG_MAVEN = setOf(SLF4J_MAVEN, LOG4J_MAVEN, COMMON_LOGGING_MAVEN)
class ClassLoggingConsoleFilterProvider : ConsoleFilterProvider { class ClassLoggingConsoleFilterProvider : ConsoleFilterProvider {
override fun getDefaultFilters(project: Project): Array<Filter> { override fun getDefaultFilters(project: Project): Array<Filter> {

View File

@@ -7,6 +7,7 @@ import com.intellij.codeInsight.hint.HintUtil
import com.intellij.execution.filters.HyperlinkInfoFactory.HyperlinkHandler import com.intellij.execution.filters.HyperlinkInfoFactory.HyperlinkHandler
import com.intellij.execution.filters.impl.MultipleFilesHyperlinkInfoBase import com.intellij.execution.filters.impl.MultipleFilesHyperlinkInfoBase
import com.intellij.openapi.fileEditor.OpenFileDescriptor import com.intellij.openapi.fileEditor.OpenFileDescriptor
import com.intellij.openapi.project.DumbModeBlockedFunctionality
import com.intellij.openapi.project.DumbService import com.intellij.openapi.project.DumbService
import com.intellij.openapi.project.Project import com.intellij.openapi.project.Project
import com.intellij.openapi.ui.popup.Balloon import com.intellij.openapi.ui.popup.Balloon
@@ -51,12 +52,14 @@ class OnFlyMultipleFilesHyperlinkInfo internal constructor(private val myInfoCac
override fun showNotFound(project: Project, hyperlinkLocationPoint: RelativePoint?) { override fun showNotFound(project: Project, hyperlinkLocationPoint: RelativePoint?) {
if (hyperlinkLocationPoint == null) return if (hyperlinkLocationPoint == null) return
val message = if (DumbService.isDumb(project)) { if (DumbService.isDumb(project)) {
CodeInsightBundle.message("notification.navigation.is.not.available.while.indexing") DumbService.getInstance(project).showDumbModeNotificationForFunctionality(
} CodeInsightBundle.message("message.navigation.is.not.available.here.during.index.update"),
else { DumbModeBlockedFunctionality.GotoClass
JvmAnalysisBundle.message("action.find.similar.stack.call.methods.not.found") )
return
} }
val message = JvmAnalysisBundle.message("action.find.similar.stack.call.methods.not.found")
val label = HintUtil.createWarningLabel(message) val label = HintUtil.createWarningLabel(message)
JBPopupFactory.getInstance().createBalloonBuilder(label) JBPopupFactory.getInstance().createBalloonBuilder(label)
.setFadeoutTime(4000) .setFadeoutTime(4000)