Skip to content

Commit

Permalink
fix: Read access is allowed from inside read-action (or EDT) (#745)
Browse files Browse the repository at this point in the history
Fixes #726

Signed-off-by: Jeff MAURY <jmaury@redhat.com>
  • Loading branch information
jeffmaury authored Feb 28, 2023
1 parent 4ee0a0f commit 3f3c52c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static Document getDocument(VirtualFile docFile) {

public static Module getProject(VirtualFile file) {
for (Project project : ProjectManager.getInstance().getOpenProjects()) {
Module module = ProjectFileIndex.getInstance(project).getModuleForFile(file);
Module module = ReadAction.compute(() -> ProjectFileIndex.getInstance(project).getModuleForFile(file));
if (module != null) {
return module;
}
Expand Down

0 comments on commit 3f3c52c

Please sign in to comment.