Skip to content

Commit

Permalink
#1614 fix "ListPopupStep" issues of PhpStorm 2021.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Haehnchen committed May 10, 2021
1 parent 92c347e commit ef98e13
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @author Daniel Espendiller <daniel@espendiller.net>
*/
public class ProfilerFactoryUtil {
private static ProfilerFactoryInterface[] PROFILER = new ProfilerFactoryInterface[] {
private static final ProfilerFactoryInterface[] PROFILER = new ProfilerFactoryInterface[] {
new HttpProfilerFactory(),
new LocalProfilerFactory(),
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package fr.adrienbrault.idea.symfony2plugin.profiler.widget;

import com.intellij.openapi.actionSystem.ActionGroup;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.DefaultActionGroup;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.actionSystem.impl.SimpleDataContext;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.fileEditor.FileEditorManager;
import com.intellij.openapi.fileEditor.FileEditorManagerEvent;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.popup.ListPopup;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.wm.IdeFocusManager;
import com.intellij.openapi.wm.StatusBarWidget;
import com.intellij.openapi.wm.impl.status.EditorBasedWidget;
import com.intellij.ui.popup.PopupFactoryImpl;
Expand Down Expand Up @@ -144,8 +143,30 @@ private void attachProfileItem(Collection<AnAction> controllerActions, Map<Strin
@Nullable
@Override
public ListPopup getPopupStep() {
if (isDisposed()) {
return null;
}

ActionGroup popupGroup = getActions();
return new PopupFactoryImpl.ActionGroupPopup("Symfony Profiler", popupGroup, SimpleDataContext.getProjectContext(getProject()), false, false, false, true, null, -1, null, null);

DataContext dataContext = SimpleDataContext.builder()
.add(CommonDataKeys.PROJECT, getProject())
.add(PlatformDataKeys.CONTEXT_COMPONENT, IdeFocusManager.getInstance(getProject()).getFocusOwner())
.build();

return new PopupFactoryImpl.ActionGroupPopup(
"Symfony Profiler",
popupGroup,
dataContext,
false,
false,
false,
true,
null,
-1,
null,
null
);
}

@Nullable
Expand Down

0 comments on commit ef98e13

Please sign in to comment.