mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 23:39:07 +07:00
IJPL-149317 Disable Write Intent Lock for runnables executed on EDT
Add explicit locks in usage view. GitOrigin-RevId: 66aa9988fb33b69574d973cff2c8fd1edab44098
This commit is contained in:
committed by
intellij-monorepo-bot
parent
63637a3137
commit
290402323f
@@ -10,6 +10,7 @@ import com.intellij.openapi.actionSystem.AnAction
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent
|
||||
import com.intellij.openapi.application.EDT
|
||||
import com.intellij.openapi.application.readAction
|
||||
import com.intellij.openapi.application.writeIntentReadAction
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.ui.SimpleToolWindowPanel
|
||||
import com.intellij.openapi.util.Disposer
|
||||
@@ -186,7 +187,7 @@ internal class MostCommonUsagePatternsComponent(
|
||||
previewComponent.renderCluster(loadedSnippet.usageInfo, loadedSnippet.renderingData)
|
||||
}
|
||||
else {
|
||||
previewComponent = create(usageView, loadedSnippet.usageInfo, loadedSnippet.renderingData, this)
|
||||
previewComponent = writeIntentReadAction { create(usageView, loadedSnippet.usageInfo, loadedSnippet.renderingData, this) }
|
||||
myMainPanel.add(previewComponent)
|
||||
previewComponents.add(previewComponent)
|
||||
}
|
||||
|
||||
@@ -155,7 +155,10 @@ open class UsagePreviewPanel @JvmOverloads constructor(project: Project,
|
||||
myEditor = createEditor(psiFile, document)
|
||||
lineHeight = myEditor!!.lineHeight
|
||||
myEditor!!.setBorder(if (myIsEditor) null else JBEmptyBorder(0, UIUtil.LARGE_VGAP, 0, 0))
|
||||
add(myEditor!!.component, BorderLayout.CENTER)
|
||||
//maybe readaction
|
||||
writeIntentReadAction {
|
||||
add(myEditor!!.component, BorderLayout.CENTER)
|
||||
}
|
||||
invalidate()
|
||||
validate()
|
||||
}
|
||||
@@ -164,7 +167,10 @@ open class UsagePreviewPanel @JvmOverloads constructor(project: Project,
|
||||
if (infos != myCachedSelectedUsageInfos // avoid moving viewport
|
||||
|| !UsageViewPresentation.arePatternsEqual(myCachedSearchPattern, myPresentation.searchPattern)
|
||||
|| myCachedReplaceString != myPresentation.replaceString || myCachedCaseSensitive != myPresentation.isCaseSensitive) {
|
||||
highlight(infos, myEditor!!, project, myShowTooltipBalloon, HighlighterLayer.ADDITIONAL_SYNTAX)
|
||||
//maybe readaction
|
||||
WriteIntentReadAction.run {
|
||||
highlight(infos, myEditor!!, project, myShowTooltipBalloon, HighlighterLayer.ADDITIONAL_SYNTAX)
|
||||
}
|
||||
myCachedSelectedUsageInfos = infos
|
||||
myCachedSearchPattern = myPresentation.searchPattern
|
||||
myCachedCaseSensitive = myPresentation.isCaseSensitive
|
||||
|
||||
Reference in New Issue
Block a user