Skip to content

Commit

Permalink
Fix threading issues with dialog creation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Layoric committed Sep 30, 2024
1 parent 85fa72f commit 90ab7b7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/main/java/net/servicestack/idea/AddPythonAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ public void actionPerformed(@NotNull AnActionEvent anActionEvent) {
}

private void showDialog(AddPythonRef dialog) {
dialog.setVisible(true);
try (var token = com.intellij.concurrency.ThreadContext.resetThreadContext()) {
dialog.setVisible(true);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ else if (IDEAPomFileHelper.isMavenProjectWithKotlin(module)) {
else if (GradleBuildFileHelper.isDartProject(module)) {
dialog.setFileName("dtos.dart");
}

dialog.setVisible(true);
try (var token = com.intellij.concurrency.ThreadContext.resetThreadContext()) {
dialog.setVisible(true);
}
}

private PsiPackage testPackage(Module module, String packageName, List<String> packageArray) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ public void actionPerformed(@NotNull AnActionEvent anActionEvent) {
}

private void showDialog(AddTypeScriptRef dialog) {
dialog.setVisible(true);
try (var token = com.intellij.concurrency.ThreadContext.resetThreadContext()) {
dialog.setVisible(true);
}
}

@Override
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/net/servicestack/idea/php/AddPhpAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ public void actionPerformed(@NotNull AnActionEvent anActionEvent) {
}

private void showDialog(AddPhpRef dialog) {
dialog.setVisible(true);
try (var token = com.intellij.concurrency.ThreadContext.resetThreadContext()) {
dialog.setVisible(true);
}
}

@Override
Expand Down

0 comments on commit 90ab7b7

Please sign in to comment.