mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 23:39:07 +07:00
[inlays] Fix slow operation in AnnotationsPreloader
Retrieving the file type can be slow in some cases and shouldn't be called on EDT. #IDEA-352817 Fixed GitOrigin-RevId: 1c9550cf2a8c5a499700c740df31a38b5f09a9dd
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1465ba0763
commit
5088053cf6
@@ -43,7 +43,7 @@ internal class AnnotationsPreloader(private val project: Project) {
|
||||
}
|
||||
|
||||
fun schedulePreloading(file: VirtualFile) {
|
||||
if (project.isDisposed || file.fileType.isBinary) return
|
||||
if (project.isDisposed) return
|
||||
|
||||
updateQueue.queue(object : DisposableUpdate(project, file) {
|
||||
override fun doRun() {
|
||||
@@ -51,6 +51,7 @@ internal class AnnotationsPreloader(private val project: Project) {
|
||||
val start = System.currentTimeMillis()
|
||||
|
||||
if (!FileEditorManager.getInstance(project).isFileOpen(file)) return
|
||||
if (file.fileType.isBinary) return
|
||||
val annotationProvider = getAnnotationProvider(project, file) ?: return
|
||||
|
||||
annotationProvider.populateCache(file)
|
||||
|
||||
Reference in New Issue
Block a user