mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-CR-62240 ensure that EP is not loaded without a reason
GitOrigin-RevId: e3b06098d5a212c231f9d4e73d12772f23680f7d
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6c423b03a6
commit
d1d229a88c
@@ -102,7 +102,7 @@ class WindowInfoImpl : Cloneable, WindowInfo, BaseState() {
|
||||
override val isDocked: Boolean
|
||||
get() = type == ToolWindowType.DOCKED
|
||||
|
||||
fun normalizeAfterRead() {
|
||||
internal fun normalizeAfterRead() {
|
||||
setTypeAndCheck(type)
|
||||
|
||||
if (isVisible && id != null && !canActivateOnStart(id!!)) {
|
||||
@@ -150,14 +150,12 @@ private class ToolWindowAnchorConverter : Converter<ToolWindowAnchor>() {
|
||||
}
|
||||
|
||||
private fun canActivateOnStart(id: String): Boolean {
|
||||
for (ep in listOf(
|
||||
ToolWindowEP.EP_NAME.extensionList,
|
||||
FacetDependentToolWindow.EXTENSION_POINT_NAME.extensionList,
|
||||
LibraryDependentToolWindow.EXTENSION_POINT_NAME.extensionList).flatten()
|
||||
) {
|
||||
if (id == ep.id) {
|
||||
return !ep.isDoNotActivateOnStart
|
||||
}
|
||||
}
|
||||
return true
|
||||
val ep = findEp(ToolWindowEP.EP_NAME.iterable, id)
|
||||
?: findEp(FacetDependentToolWindow.EXTENSION_POINT_NAME.iterable, id)
|
||||
?: findEp(LibraryDependentToolWindow.EXTENSION_POINT_NAME.iterable, id)
|
||||
return ep == null || !ep.isDoNotActivateOnStart
|
||||
}
|
||||
|
||||
private fun findEp(list: Iterable<ToolWindowEP>, id: String): ToolWindowEP? {
|
||||
return list.firstOrNull { id == it.id }
|
||||
}
|
||||
Reference in New Issue
Block a user