void (@NotNull Editor editor, @Nullable Caret caret, DataContext dataContext) { new Task.Modal(editor.getProject(), EditorBundle.message("fonts.used.by.editor.progress"), true) { private @Nls String textToShow; @Override public void run(@NotNull ProgressIndicator indicator) { Set<@NlsSafe String> fontNames = ReadAction.compute(() -> collectFontNames((EditorEx)editor)); textToShow = StringUtil.join(fontNames, "\n"); } @Override public void onSuccess() { if (textToShow != null) { new MyDialog(textToShow).show(); } } }.queue(); }