Commit 985eb4a
[refactoring] fix deadlock in Extract Method when multiple scopes exist #SCL-25001 fixed
Replace PsiTargetNavigator with JBPopupFactory in showPsiChooser
to avoid a deadlock caused by runBlocking on the EDT.
PsiTargetNavigator.createPopup() internally calls computeItems()
which uses runBlocking, blocking the EDT while dispatching work to
coroutine workers. Those workers contend for the indexing lock
(ChangeTrackingValueContainer), which can't be released because the
EDT is blocked. This causes a permanent deadlock (34 threads blocked).
The fix delegates to showChooserGeneric which uses JBPopupFactory —
a safe popup mechanism already used elsewhere in the same file.
Also related: #712
Co-Authored-By: Claude Code (Anthropic) <noreply@anthropic.com>1 parent ec2a3ca commit 985eb4a
1 file changed
Lines changed: 4 additions & 28 deletions
File tree
- scala/scala-impl/src/org/jetbrains/plugins/scala/lang/refactoring/util
Lines changed: 4 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | | - | |
16 | 14 | | |
17 | 15 | | |
18 | 16 | | |
| |||
547 | 545 | | |
548 | 546 | | |
549 | 547 | | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
576 | 552 | | |
577 | 553 | | |
578 | 554 | | |
| |||
0 commit comments