mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
[devkit] IJPL-179652 Avoid freezes in PluginDescriptorEditorTabTitleProvider
GitOrigin-RevId: 8c1546e855d3455f074237e250b956c28c78120c
This commit is contained in:
committed by
intellij-monorepo-bot
parent
21ff8818b2
commit
a7a6116df7
@@ -3,9 +3,11 @@ package org.jetbrains.idea.devkit.dom.ide
|
||||
|
||||
import com.intellij.ide.plugins.PluginManagerCore
|
||||
import com.intellij.openapi.application.ReadAction
|
||||
import com.intellij.openapi.application.readAction
|
||||
import com.intellij.openapi.fileEditor.impl.EditorTabTitleProvider
|
||||
import com.intellij.openapi.project.DumbService
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.util.NlsContexts
|
||||
import com.intellij.openapi.vfs.VirtualFile
|
||||
import org.jetbrains.idea.devkit.dom.index.PluginIdDependenciesIndex
|
||||
|
||||
@@ -24,4 +26,18 @@ internal class PluginDescriptorEditorTabTitleProvider : EditorTabTitleProvider {
|
||||
|
||||
return "${PluginManagerCore.PLUGIN_XML} (${pluginId})"
|
||||
}
|
||||
|
||||
override suspend fun getEditorTabTitleAsync(project: Project, file: VirtualFile): @NlsContexts.TabTitle String? {
|
||||
if (PluginManagerCore.PLUGIN_XML != file.name) return null
|
||||
|
||||
val pluginId = readAction {
|
||||
if (DumbService.isDumb(project)) {
|
||||
return@readAction null
|
||||
}
|
||||
|
||||
PluginIdDependenciesIndex.getPluginId(project, file)
|
||||
} ?: return null
|
||||
|
||||
return "${PluginManagerCore.PLUGIN_XML} (${pluginId})"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user