File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
ide-common/src/main/kotlin/org/digma/intellij/plugin/reload Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,12 @@ class ReloadService : DisposableAdaptor {
7979 }
8080
8181 latestReloadForProject[project.name] = Clock .System .now()
82- reloadImpl(project)
82+
83+ // run the whole project reload on EDT, it may cause a short freeze, but we are aware of that.
84+ // it is necessary for finding the selected editor
85+ EDT .ensureEDT {
86+ reloadImpl(project)
87+ }
8388 }
8489 }
8590
@@ -103,7 +108,14 @@ class ReloadService : DisposableAdaptor {
103108 }
104109 }
105110
106- val selectedEditor = FileEditorManager .getInstance(project).selectedEditor
111+ // because of the way we reload jaeger ui and dashboard by closing and opening the files again,
112+ // we want to try and restore the selected editor
113+ val selectedEditor = if (EDT .isEdt()) {
114+ FileEditorManager .getInstance(project).selectedEditor
115+ } else {
116+ null
117+ }
118+
107119 reloadables.filter { it.getProject().name == project.name }.forEach {
108120 EDT .ensureEDT {
109121 try {
You can’t perform that action at this time.
0 commit comments