Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0).

## 2026.1.0
## 2026.1.1

### Added

Expand All @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0).
### Fixed

- java.lang.runtime exception java.util.concurrent.execution exception java.nio.file.invalid path exception [#2640](https://github.com/magento/magento2-phpstorm-plugin/pull/2640)
- Internal API usages

## 2025.2.2

Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
pluginGroup = com.magento.idea.magento2plugin
pluginName = Magento PhpStorm
pluginRepositoryUrl = https://github.com/magento/magento2-phpstorm-plugin
pluginVersion = 2026.1.0
pluginVersion = 2026.1.1
pluginSinceBuild = 261.21525.38
pluginUntilBuild = 268.*
platformType = PS
platformVersion = 261.21525.38
platformPlugins = com.intellij.lang.jsgraphql:261.21525.28
platformVersion = 261.22158.208
platformPlugins = com.intellij.lang.jsgraphql:261.22158.185
platformBundledPlugins = com.intellij.modules.json,com.jetbrains.php,JavaScript,com.intellij.css,org.jetbrains.plugins.yaml,com.intellij.copyright
gradleVersion = 9.3.1
kotlin.stdlib.default.dependency = true
org.gradle.configuration-cache = true
org.gradle.caching = true
org.gradle.caching = true
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.startup.StartupManager;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.platform.ProjectGeneratorPeer;
import com.intellij.psi.PsiDirectory;
Expand All @@ -24,6 +23,7 @@
import com.magento.idea.magento2plugin.actions.generation.generator.ModuleXmlGenerator;
import com.magento.idea.magento2plugin.init.ConfigurationManager;
import com.magento.idea.magento2plugin.project.Settings;
import com.magento.idea.magento2plugin.project.startup.DeferredProjectOpenActions;
import java.util.ArrayList;
import javax.swing.Icon;
import org.jetbrains.annotations.Nls;
Expand Down Expand Up @@ -91,7 +91,7 @@ public void generateProject(
.refreshIncludePaths(dataService.getState(), project);
});
};
StartupManager.getInstance(project).runAfterOpened(generate);
DeferredProjectOpenActions.getInstance(project).runAfterProjectOpened(generate);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.DumbService;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.startup.StartupManager;
import com.intellij.openapi.util.Ref;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.platform.DirectoryProjectConfigurator;
import com.magento.idea.magento2plugin.indexes.IndexManager;
import com.magento.idea.magento2plugin.magento.packages.MagentoComponentManager;
import com.magento.idea.magento2plugin.project.startup.DeferredProjectOpenActions;
import com.magento.idea.magento2plugin.util.magento.MagentoBasePathUtil;
import com.magento.idea.magento2plugin.util.magento.MagentoVersionUtil;
import javax.swing.event.HyperlinkEvent;
Expand All @@ -31,7 +31,7 @@ public void configureProject(
final @NotNull Ref<Module> moduleRef,
final boolean newProject
) {
StartupManager.getInstance(project).runAfterOpened(() -> {
DeferredProjectOpenActions.getInstance(project).runAfterProjectOpened(() -> {
DumbService.getInstance(project).smartInvokeLater(() -> {
if (!MagentoBasePathUtil.isMagentoFolderValid(baseDir.getPath())) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ private void registerSettings(final @NotNull Project project) {
if (settings.pluginEnabled && (path == null || path.isEmpty())) {
if (MagentoBasePathUtil.isMagentoFolderValid(project.getBasePath())) {
settings.setMagentoPath(project.getBasePath());
return;
} else {
settings.pluginEnabled = false;
ConfigurationManager.suggestToConfigureMagentoPath(project);
}
settings.pluginEnabled = false;
ConfigurationManager.suggestToConfigureMagentoPath(project);
}
DeferredProjectOpenActions.getInstance(project).runPendingActions();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

package com.magento.idea.magento2plugin.project.startup;

import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import org.jetbrains.annotations.NotNull;

public final class DeferredProjectOpenActions {
private static final Logger LOGGER = Logger.getInstance(DeferredProjectOpenActions.class);

private final Project project;
private final Queue<Runnable> pendingActions = new ConcurrentLinkedQueue<>();

public DeferredProjectOpenActions(final @NotNull Project project) {
this.project = project;
}

public static DeferredProjectOpenActions getInstance(final @NotNull Project project) {
return project.getService(DeferredProjectOpenActions.class);
}

public void runAfterProjectOpened(final @NotNull Runnable action) {
if (project.isDisposed()) {
return;
}
if (project.isInitialized()) {
runAction(action);
return;
}
pendingActions.add(action);
}

public void runPendingActions() {
Runnable action;
while ((action = pendingActions.poll()) != null) {
if (project.isDisposed()) {
return;
}
runAction(action);
}
}

private void runAction(final @NotNull Runnable action) {
try {
action.run();
} catch (RuntimeException exception) {
LOGGER.warn("Failed to run deferred post-open action", exception);
}
}
}
1 change: 1 addition & 0 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@

<projectService serviceImplementation="com.magento.idea.magento2plugin.project.Settings"/>
<projectService serviceImplementation="com.magento.idea.magento2uct.settings.UctSettingsService"/>
<projectService serviceImplementation="com.magento.idea.magento2plugin.project.startup.DeferredProjectOpenActions"/>

<completion.contributor language="XML" implementationClass="com.magento.idea.magento2plugin.completion.xml.XmlCompletionContributor" id="xml"/>
<completion.contributor language="PHP" implementationClass="com.magento.idea.magento2plugin.completion.php.PhpCompletionContributor" id="php"/>
Expand Down
Loading